1

Whenever I try logging into my site with a wrong user details, I get redirected from www.example.com/ to www.example.com/index.php.

I would like to remove index.php from my link.

Here is the content of my htaccess file, which does not work for me.

RewriteEngine On

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

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.php\ HTTP/
RewriteRule ^(.*)\.php$ /$1 [R=301,L]

RewriteRule ^login index.php [NC,L]

2 Answers2

0

Check if this can work for you:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
0

Check mod_rewrite module is enabled if not you first enable it.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

Reference

htaccess documrntation

Gufran Hasan
  • 8,910
  • 7
  • 38
  • 51