【发布时间】:2013-04-22 16:01:44
【问题描述】:
我正在 MAMP 上构建我的网站,几天后我终于得到了一个 .htaccess 文件,可以按照我的意愿工作。但是现在当我上传到实时环境时,它的行为就不一样了!有不同的版本吗?是因为我的文件中的错误,MAMP 会自动处理吗?
如果不是这些特殊文件,则使用默认的 RewriteRule。 scripts/images/mediacontent/services/robot.txt 有效,但不能(login.php、hybridauth、blog)
#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 临时移动”
标签: .htaccess mod-rewrite mamp