0

我遇到了“我的网站上的重定向太多”的 Apache 问题。我一直在尝试以不同的方式修复它,但我找不到解决方案。

referer = http://www.mysite.com/
lang = en | es | fr
page = page1, page2, page3

eg: referer/lang, referer/lang/
eg: referer/lang/page, referer/lang/page/
eg: referer/lang/something/apage, referer/lang/something/apage/

这是我的规则:

//Rewrite my ajax page location to avoid problems due to /lang/
RewriteRule ^(?:en|es|fr)/{0,1}ajax/ajax.php$ ajax/ajax.php [L]

//Rewrite /lang without page
RewriteRule ^(en|es|fr)/{0,1}$ /?lang=$1 [L]

//Rewrite referer/lang/something/unepage
RewriteRule ^(en|es|fr)/(somethinges|somethingfr|somethingen)/(apage1|apage2|apage3)$ /?lang=$1&page=$3 [L]

//Rewrite /lang/page
RewriteRule ^(en|es|fr)/(.*)$ /?lang=$1&page=$2 [L]

我试图用 %{HTTP_REFERER}?... 替换 /?...

4

0 回答 0