I'm trying to setup .htaccess for my website. I want to redirect user to index.php if is entered wrong url address. But when I enter wrong url It does not redirect me to index.php but it shows me an error(Not Found 404 error was encountered while trying to use an ErrorDocument).
My .htaccess file
Options -Indexes
DirectoryIndex index.php
<IFModule mod_rewrite.c>
RewriteEngine On
RewriteBase /rop/
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([A-Za-z0-9-\/&_]+)/?$ index.php?etc=$1 [L]
</IfModule>
<Files config.php>
deny from all
</Files>
ErrorDocument 404 /index.php
ErrorDocument 403 /rop/pages/error/403.html
Thanks for help.