为什么页面未找到系统无法在.htaccess文件中工作?

时间:2016-04-09 17:58:58

标签: php .htaccess

当用户输入错误的网址时,我正在使用以下.htaccess规则来显示not-found.php页面,例如www.myurl.com/wrong

我的.htaccess文件:

ErrorDocument 404 /not-found.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]

但不知怎的,它不起作用。它告诉我

Not Found

The requested URL /myfolder/mysite/gift-cardsdf was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.5.28 Server at localhost Port 80

我该如何解决?

0 个答案:

没有答案