我的问题是我想用htaccess重命名这2个网址,我不知道
想转换
mydomain.com/info.php?act=statistics
mydomain.com/info.php?act=about_us
到
mydomain.com/statistics
mydomain.com/about_us
我将非常感激,因为我对htaccess一无所知。
答案 0 :(得分:4)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /info.php?act=$1 [L]
这会传递给/info.php?act=whatever 的! -f和! -d RewriteCond检查以确保文件不存在。