9

我在以下页面有一个登录表单:

site.com/en/downloads

“en” 是 user_language (并存储在全局变量中)

当我登录时,表单会将我重定向到:

site.com/downloads

虽然它应该使用我的 user_language 将我重定向到 URL

我尝试了很多东西,但返回值的值总是被忽略。

  • 返回 =”{site_url}/{user_language}/downloads”</li>
  • 返回 =”{site_url}”</li>
  • 返回 =“http://site.com”</li>
  • 返回 =“http://google.com”</li>
  • return =“关于/索引”</li>

他们都重定向到 site.com/downloads。

正在输出的代码(对于最后一个示例)如下所示:

<form method="post" action="http://site.com/"  >
<div class='hiddenFields'>
<input type="hidden" name="XID" value="9fae3b1b5fcf882776da6638706595af73a7b15d" />
<input type="hidden" name="ACT" value="7" />
<input type="hidden" name="RET" value="about/index" />
<input type="hidden" name="site_id" value="1" />
</div> 

我有一个看起来像这样的 .htaccess:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L] 

更新:

我尝试按照建议使用freemember,但问题仍然存在:

I've set the return value to "about/index", but I'm still being redirected to site.com/downloads.

The code generated by freemember looks solid though, so something must be overriding the return value.

<form method="post" action="http://site.com/downloads"  >
<div class='hiddenFields'>
<input type="hidden" name="XID" value="d9483688fbf63d9ea47e89a66e074b99f5b8465c" />
<input type="hidden" name="ACT" value="18" />
<input type="hidden" name="_params" value="wvkEsN96mPfmlhgerM2ppxGbMmiLJrz0Ntn7apKer/rmBpQaUozvSM0TvkVN66QlX/ptCM1IQGsuZuw7X3mzlOMCFIUyYFpbZy5h7nfPJMiHLdpqXqwBFOiA/zcNW0GKAIicv4JPAS2mfHKQE+mb2Ct0L+jhGz0NlSdELuMOeqQPJJ3B7U90D5w/sKTeaX5zaOMSvKJ4LZ7xP0Dn+UxE9g==" />
<input type="hidden" name="return_url" value="about/index" />
<input type="hidden" name="site_id" value="1" />
</div>
4

3 回答 3

3

I finally figured it out.

Apparently I was still using a small plugin called "Twomile Login Redirect" which hijacked my login code ( even when it was disabled, I had to remove it )

So all is well now.

Lesson learned: remove old plugins :)

于 2012-11-05T09:10:59.247 回答
1

When you use the return="{user_language}/about/index" parameter as you mentioned above, does it correctly output the RET variable in the HTML code? How about just adding your own RET hidden input field? Just put this inside your login form somewhere:

<input type="hidden" name="RET" value="{user_language}/about/index" />

According to the HTML spec, if two inputs have the same name, then the later one will override any previous ones, so there is no problem doing it this way.

Alternatively, you could try using the Freemember plugin - you might have more luck with the return URL, and you can avoid the nasty grey redirect pages as well. </shameless-plug>

于 2012-10-31T09:46:07.550 回答
1

i might be looking at this to superficcially, but couldn't you use

return =”{segment_1}/downloads”
于 2012-11-03T20:15:58.210 回答