繁体   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