0

我使用 MAMP 在我的 Mac 上开发了一个 Web 应用程序。该应用程序使用 .htaccess 文件,该文件包含在根目录中。在我的本地 MAMP 环境中进行测试时,一切都很好。但是,当我移动到我的托管服务器(运行 Red Hat Linux 的专用服务器)时,我在 .htaccess 文件中的重写规则无法正常工作。例如,当用户登录到我的站点时,重写规则会将他们带到http://www.mysite.com/authenticate/login(看起来 .htaccess 中的重写规则有效)。但是,我收到 404 文件未找到错误。任何人都可以看到问题是什么?这是 .htaccess 文件中的代码:

ErrorDocument 404 /index.php
DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
</IfModule>
Options -indexes
4

1 回答 1

1

AllowOverride指令是否在生产服务器上正确设置?

http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride

于 2012-07-03T01:57:28.687 回答