如何更改
www.example.com/index.php?page=2_4_home
到
www.example.com/2/4/home
或
www.example.com/2/4/home/
用htaccess?感谢
答案 0 :(得分:1)
尝试
RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)/([a-zA-Z]+)/?$ /index.php?page=$1_$2_$3 [L]
答案 1 :(得分:0)
尝试:
RewriteEngine On
RewriteCond %{THE_REQUEST} \ /+(?:index\.php|)\?page=([0-9]+)_([0-9]+)_([^&\ ]+)
RewriteRule ^ /%1/%2/%3/? [L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/([0-9]+)/([^/]+)/? /index.php?page=$1_$2_$3 [L,QSA]