Php 错误500.htaccess
好的!我已经做了一个多小时了,在谷歌上搜索,四处寻找答案。 每当我尝试访问我的页面时,我都会得到以下信息:Php 错误500.htaccess,php,apache,.htaccess,Php,Apache,.htaccess,好的!我已经做了一个多小时了,在谷歌上搜索,四处寻找答案。 每当我尝试访问我的页面时,我都会得到以下信息: Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a serv
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.10 (Unix) OpenSSL/1.0.1j PHP/5.6.3 mod_perl/2.0.8-dev Perl/v5.16.3
我已经在htaccess文件中找到了问题所在。
我做错了什么
Htaccess文件
RewriteEngine On
RewriteBase /
RewriteRule ^i([0-9]+)$ view.php?id=$1 [QSA,L]
RewriteRule ^login$ login.php [QSA,L]
RewrireRule ^register$ register.php [QSA,L]
通过打开错误日志,我发现了问题,我错发了上一条重写规则。尽管它现在给了我一个404页。多亏了@sumurai8,它现在可以工作了
我错发了上一条重写规则我想这是因为您试图以多个文件为基础,尝试从一个文件(例如index.php)开始,然后从那里添加代码。您有权访问错误日志吗?请打开您的apache错误日志,查看其中写入的内容。乍一看,你的规则似乎没有问题。mod_rewrite是否已启用?@DanFromGermany该指令只能在服务器配置或虚拟主机上下文中出现。它不能位于.htaccess文件中。参见Thank@Sumurai8,通过打开错误日志,我找到了问题所在,我错发了上一条重写规则。编辑:它现在给了我一个404页。