RewriteEngine隐藏扩展名?lang =“xx”

时间:2015-03-29 02:17:33

标签: php .htaccess

如何使用.htaccess重写此网址?

或隐藏?lang=es

http://website/services?lang=es 

到:

http://website/services/es

1 个答案:

答案 0 :(得分:2)

.htaccess文件中尝试此操作:

<IfModule mod_rewrite.c>  
RewriteEngine on  
RewriteRule ^services/([a-zA-Z]{2})/?$ /services?lang=$1 [QSA,L] 
</IfModule>