[英]Htaccess Rename php file into friendly url
我的問題是我想用htaccess重命名這2個URL,我不知道
想要轉換
mydomain.com/info.php?act=statistics
mydomain.com/info.php?act=about_us
成
mydomain.com/statistics
mydomain.com/about_us
我將不勝感激,因為我對htaccess一無所知。
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /info.php?act=$1 [L]
這會將/ whatever傳遞給/info.php?act=whatever! -f和! -d RewriteCond檢查以確保該文件首先不存在。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.