我在同一目录中有两个页面,如:
www.example.com/index.php?page=about
www.example.com/page.php?var=abc
我希望它像:
www.example.com/about
www.example.com/var/abc
答案 0 :(得分:0)
这可能就是你要找的东西。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^var/([^/]+) page.php?var=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+) index.php?page=$1 [L]