我在MAMP上建立我的網站,幾天後,我終於有了一個.htaccess文件,可以在我的意志之後工作。但是現在,當我上傳到現場環境時,它的行爲並不一樣!有不同的版本嗎?是否因爲我的文件中的錯誤MAMP處理自動?.htaccess MAMP與生活環境的差異
如果不是這些特殊文件,則使用默認的RewriteRule。腳本/圖片/ mediacontent /服務/ robot.txt的作品,但NOT(login.php中,hybridauth,博客)
#start
Options +FollowSymlinks
RewriteEngine On
RewriteBase/
# main site
RewriteCond %{REQUEST_URI} !^/scripts/(.*\.js)$
RewriteCond %{REQUEST_URI} !^/styles/(.*\.css)$
RewriteCond %{REQUEST_URI} !^/images/(.*\.jpg|.*\.png|.*\.gif)$
RewriteCond %{REQUEST_URI} !^/mediacontent/(.*\.jpg|.*\.png)$ [NC]
RewriteCond %{REQUEST_URI} !^/services/(.*\.php)$
RewriteCond %{REQUEST_URI} !^/login\.php$
RewriteCond %{REQUEST_URI} !^/hybridauth/$
RewriteCond %{REQUEST_URI} !^/blog/$ [NC]
RewriteCond %{REQUEST_URI} !^/robot.txt$
RewriteRule (\w+) index.php?page=$1 [NC,L]
對於那些不起作用的東西,我會得到「302 Moved Temporarily」 – Backer 2013-04-22 16:13:21