Andre Hoffmann Andre Hoffmann - 1 year ago 69
HTML Question

.htaccess Error 404 on index file

Good day,

I was wondering if you could help me.

I have a .htaccess file:

RewriteEngine On
RewriteRule ^ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

## hide .php extension snippet

# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]

ErrorDocument 404

When i try to open it give me an error 404 but when i try to open it works 100%
Could you please help me?

Answer Source

try this...

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download