有了这个的.htaccess代码:mod_rewrite的多语言,多URL级别
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} !www.example.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).example.com [NC]
RewriteRule ^(.*)/(.*)$ http://example.com/$2?lang=%2 [L,P]
</IfModule>
这伟大工程!对于下面的例子:
RewriteRule ^awards$ premios.php [L,QSA]
http://pt.example.com/awards ==> /premios.php?lang=pt
http://en.example.com/awards ==> /premios.php?lang=en
如果URL具有多级别如下:
RewriteRule ^gallery/funny$ gallery-funny.php [L,QSA]
该URL http://pt.example.com/gallery/funny不起作用!
任何帮助?我迷失在这里。
你可以显示完整的.htaccess有问题吗?然后再添加重写不起作用。 – anubhava 2015-03-19 15:36:50