我有以下.htaccess
配置mod_rewrite的配置爲/
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteRule \.git - [F,L]
RewriteRule ^help help.php [L]
RewriteRule ^home home.php [L]
RewriteRule ^profile profile.php [L]
RewriteRule ^index index.php [L]
RewriteRule ^users/([0-9]+) profile.php?id=$1 [L]
RewriteRule ^([A-Za-z0-9-]+)?$ profile.php?u=$1 [L]
現在,每當有人訪問登陸頁面,它們會使用profile.php?u=$1
的最後一個規則重定向。
如何更改配置以便www.example.com
和www.example.com/
映射到index.php而不是profile.php?
可惜只有8分鐘後,我可以接受的答案。謝謝一堆! – kapeels