你好,我有这种格式的网址:http://domain.com/index.php?action=page&name=privacy 想使用htaccess使用domain.com/page/privacy而不是http://domain.com/index.php?action=page&name=privacy。任何想法,请
RewriteRule \/index\.php\/(.*)$ /action/$1
答案 0 :(得分:1)
您的根目录中需要此规则.htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?action=$1&name=$2 [L,QSA]