开发者

Mod rewrite multiple languages

Alright im doing a site which is available in multiple languages. I have ran into some problems with my mod rewrite. I'm trying to do this:

Normal page without extra querystrings: /en/whatever

And the page with problems (with querystrings): /en/dashboard/project/projectid

And my .htaccess:

RewriteRule ^en/(.*)$ $1?lang=en [NC,L,QSA]
RewriteRule ^dashboard/project/([a-z0-9]+)$ projectdashboard.php?id=$1

But the ?la开发者_运维知识库ng=en is getting lost when opening this page: /en/dashboard/project/projectid


Use the QSA flag in both rules:

RewriteRule ^en/(.*)$ $1?lang=en [NC,QSA]
RewriteRule ^dashboard/project/([a-z0-9]+)$ projectdashboard.php?id=$1 [QSA]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜