簡體   English   中英

為什么.htaccess文件在本地MAMP測試服務器上可以正常運行,而在Linux生產服務器上卻不能正常運行?

[英]Why did my .htaccess file work fine on my local MAMP testing server, but doesn't work on my Linux production server?

我使用MAMP在Mac上開發了一個Web應用程序。 該應用程序使用.htaccess文件,該文件包含在根目錄中。 在我本地的MAMP環境中進行測試時,一切工作都很好。 但是,當我移到托管服務器(運行Red Hat Linux的專用服務器)時,.htaccess文件中的重寫規則無法正常工作。 例如,當用戶登錄到我的站點時,重寫規則會將他們帶到http://www.mysite.com/authenticate/login (應該顯示的規則。)。 但是,我得到一個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

生產服務器上是否正確設置了AllowOverride指令?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM