奇怪的 htaccess 问题
我在 .htaccess
中有一个网站,
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?menu=$1 [L,QSA]
#DirectoryIndex index.php
我的问题是,如果我更改一个字母,网站就会呈现 500 错误。即使我清空整个文件,它仍然显示 500 错误。
我想做的是,域上有一个这样的页面
http://www.example.co.uk/brochure/generate.php
文件 generate.php
确实存在于 /brochure/
目录中。
但 generate.php
仍然没有加载,它正在加载 index.php
文件。
有什么帮助吗?
I have a website with this in the .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?menu=$1 [L,QSA]
#DirectoryIndex index.php
My problem is even, if I change a single letter the website is rendering a 500 Error. Even if I empty complete file, it still shows me the 500 Error.
What I want to do is, there is a page like this on the domain
http://www.example.co.uk/brochure/generate.php
The file generate.php
does exist in /brochure/
directory.
But still the generate.php
does not load and it is loading the index.php
file.
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试以下我知道应该有效的操作:
如果您没有看到任何重写发生,请检查是否安装了重写模块。
Try the following which I know should work:
if you do not see any rewriting taking palce then check to see the module for rewrite is installed.
如果空文件也触发了500状态代码,那么错误就在其他地方:您没有编辑Apache正在使用的真实
.htaccess
文件,错误就会出现 在任何情况下,您都应该找到错误日志:那里显示了确切的详细信息。在 Linux 中,它通常位于
/var/log/httpd
下。在 Windows 中,它可以位于%ProgramFiles%\Apache Software Foundation\Apache2.2\logs
下。如果它是共享主机帐户,您的控制面板中可能会有“错误”或“日志”功能。If an empty file triggers a 500 status code as well, then the error is somewhere else: you are not editing the real
.htaccess
file being used by Apache, the error comes from the application, etc.In any case, you should find the error log: that's where the exact details are shown. In Linux, it's normally under
/var/log/httpd
. In Windows, it can be under%ProgramFiles%\Apache Software Foundation\Apache2.2\logs
. If it's a shared hosting account, you'll probably have an "Errors" or "Logs" feature in your control panel.