这是我在root中的.htaccess。同一个在文件夹/输入
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?content=$1
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?lang=$1&content=$2
如何在root .htaccess中打开“enter”文件夹并删除重复的htaccess?
答案 0 :(得分:0)
我认为你正在寻找这个:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
## Enter
RewriteRule ^([a-zA-Z0-9_-]+)/enter$ enter/index.php?lang=$1&content=$2 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/enter/([a-zA-Z0-9_-]+)$ enter/index.php?lang=$1&content=$2 [L]
## Root
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?content=$1
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?lang=$1&content=$2
顺便说一句: [L] 表示“最后”: http://httpd.apache.org/docs/2.4/rewrite/flags.html