网址中是否存在单词error
的问题?因为如果我输入像http://eshop.local/controller/action这样的路线,控制器可以是任何东西,那么没有问题,但如果控制器出错,它会返回:
Error 404 Page not found
我的htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
http://eshop.local/error工作正常,但如果后面有一些操作,无论单词,数字或任何内容都会返回404
错误。
修改
刚才我把它复制到了我的网站主页,所有错误网址都运行正常,所以XAMPP方面存在问题。
答案 0 :(得分:0)
保持呼吸
Config
按钮,然后选择httpd.conf
<Directory "C:/xampp/htdocs">
# AllowOverride All
。删除#
,这是一条评论答案 1 :(得分:0)
来自XAMPP论坛主持人Altrea的回复:
All URLs that are used in an Alias, Location or Proxy definition.
There are a bunch of them in XAMPP Apache (depending on which config files are activated or not some of them are maybe not used):
/cgi-bin/
/error/
/examples
/icons/
/licenses
/manual
/my-gateway/
/phpmyadmin
/php-cgi/
/security
/server-info
/server-status
/uploads
/webalizer
/webdav
In your case /error/ is already useds
是否可以重复使用例如/ error /或它&#39;最好在我的代码中将其更改为/ err /?
This Alias is used for the default Apache
error Pages (everywhere ErrorDocuemnt is used this Alias is used).
So it is possible to change it in XAMPP, but you have to
search and replace multiple files.