简体   繁体   English

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

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

I have the following code in my htaccess file: 我的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]


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

And my .htaccess directory like this : 我的.htaccess目录是这样的:

..wamp/www/.htaccess

And my website directory like this 我的网站目录是这样的

..wamp/www/Careers

When I load my careers folder or localhost it gives an error : 当我加载我的职业文件夹或本地主机时,出现错误:

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.

If you are using a .htaccess on your site, it may be interfering with the web page you are trying to load into your browser. 如果您在网站上使用.htaccess,则它可能会干扰您试图加载到浏览器中的网页。 Please double check the .htaccess configuration. 请仔细检查.htaccess配置。 Any syntax errors will cause a 500 Internal Server Error message to be displayed instead of your website. 任何语法错误都会导致显示500 Internal Server Error消息,而不是您的网站。

To confirm whether a misconfiguration .htaccess is the cause of the 500 Internal Server error, either remove or rename the .htaccess file temporarily and then try to reload the page. 要确认配置错误.htaccess是否是500 Internal Server错误的原因,请暂时删除或重命名.htaccess文件,然后尝试重新加载页面。

You can check with online htaccess tester 您可以使用在线htaccess测试仪进行检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM