-1
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /online_shoping/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]

this is my code for removing .php extension after use .php removed but ? and = still appear and also my login script failed after use this code so please guide me where m wrong?

Thanks in advance

Shubham Verma
  • 37
  • 1
  • 11

1 Answers1

0

use this it works for me

RewriteCond %{REQUEST_FILENAME}.php -f
# IF the request filename with .php extension is a file which exists
RewriteCond %{REQUEST_URI} !/$
# AND the request is not for a directory
RewriteRule (.*) $1\.php [L]
# redirect to the php script with the requested filename
user2511140
  • 1,484
  • 2
  • 24
  • 31