簡體   English   中英

.htaccess文件是否可以在本地主機上工作? 如果是,如何?

[英].htaccess file works at localhost or not ?? if yes How?

我的htaccess文件中包含以下代碼:


Options +FollowSymLinks -MultiViews


RewriteEngine On

RewriteBase /


RewriteRule ^forums/ - [L,NC]


RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]

RewriteRule ^ %1 [R,L]



RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule ^(.*?)/?$ $1.php [L]


------------------------------------------------

我的.htaccess目錄是這樣的:

..wamp/www/.htaccess

我的網站目錄是這樣的

..wamp/www/Careers

當我加載我的職業文件夾或本地主機時,出現錯誤:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

如果您在網站上使用.htaccess,則它可能會干擾您試圖加載到瀏覽器中的網頁。 請仔細檢查.htaccess配置。 任何語法錯誤都會導致顯示500 Internal Server Error消息,而不是您的網站。

要確認配置錯誤.htaccess是否是500 Internal Server錯誤的原因,請暫時刪除或重命名.htaccess文件,然后嘗試重新加載頁面。

您可以使用在線htaccess測試儀進行檢查

暫無
暫無

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

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