.htaccess 文件有问题
我面临着有关我的 .htaccess 文件的问题,这是文件中的代码,
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^category/([^/\.]+)/?$ index.php?category=$1 [L]
RewriteRule ^department/([^/\.]+)/?$ index.php?department=$1 [L]
RewriteRule ^brand/([^/\.]+)/?$ index.php?brand=$1 [L]
RewriteRule ^product/([^/\.]+)/?$ index.php?product=$1 [L]
RewriteRule ^basket/([^/\.]+)/?$ index.php?basket=$1 [L]
</IfModule>
一旦我加载网站,它就会出现此错误
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@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 文件内容,网站就会恢复正常工作
im facing a problem regarding my .htaccess file here is the code within the the file
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^category/([^/\.]+)/?$ index.php?category=$1 [L]
RewriteRule ^department/([^/\.]+)/?$ index.php?department=$1 [L]
RewriteRule ^brand/([^/\.]+)/?$ index.php?brand=$1 [L]
RewriteRule ^product/([^/\.]+)/?$ index.php?product=$1 [L]
RewriteRule ^basket/([^/\.]+)/?$ index.php?basket=$1 [L]
</IfModule>
once i load the website it gives me this error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@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.
and once i remove the .htaccess file content the site back to work normally
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
那些“内部服务器错误”消息真是令人头疼;它们几乎和根本没有错误消息一样无用。
.htaccess 文件的调试过程:
Those "Internal Server Error" messages are a pain in the ass; they're almost as useless as no error message at all.
Debug procedures for .htaccess files:
确保您使用正确的编码保存了 .htaccess 文件:我建议使用 ANSI,因为如果不是,apache 可能会出现问题。
Make sure you've saved your .htaccess file with the correct encoding: I suggest ANSI as apache can have issues if it's not.
请检查此目录是否配置为 AllowOverride 设置为 Options 或 All
Please check if this directory is configured with
AllowOverride
set to Options or All