【发布时间】:2016-06-25 07:15:45
【问题描述】:
我对语言文件夹的 mod_rewrite 规则有一些困难。我想重写任何请求: www.example.com/lang/* 到: www.example.com/*
我添加规则
RewriteRule ^lang/(.*)$ \/$1
由于我使用多种语言,我想保存在环境中,网址中的语言在第一次打开网站时输入。
我还要使用规则
SetEnvIf Referer "www.example.com/lang1/" LANG=1
SetEnvIf Referer "www.example.com/lang2/" LANG=2
所以我有语言可以在网站上显示
但是在浏览器中输入地址 www.example.com/lang1/ 时我无法获得这个环境
【问题讨论】:
标签: php apache .htaccess redirect mod-rewrite