当用户输入错误的网址时,我正在使用以下.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
我该如何解决?