htaccess重定向丑陋的多语言网址

时间:2016-10-31 16:06:52

标签: .htaccess url-redirection multilingual

我试图改变我的丑陋网址:

domain.com/page.php?lang=en
domain.com/page.php?lang=al

进入这个:

domain.com/page.php (when it's english)
domain.com/al/page.php (when it's albanian)

我已尝试过其他stackoverflow解决方案的许多答案,但没有一个对我有效。

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

domain.com/page.php?lang=en使用:

RewriteEngine On
RewriteRule ^page\.php$ /page.php?lang=en [L]

domain.com/page.php?lang=al使用:

RewriteEngine On
RewriteRule ^al/page\.php$ /page.php?lang=al [L]
相关问题