3

I have a website eg : www.abcd.com in that there are many pages. eg : www.abcd.com/one.php , www.abcd.com/two.php I just want to remove the .php from www.abcd.com/one.php and not from all the other pages.

I have tried this part in .htaccess file.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*)$ $1.php
anubhava
  • 713,503
  • 59
  • 514
  • 593
Rushit
  • 508
  • 4
  • 13

1 Answers1

6

You can use this rule in your root .htaccess:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(one)/?$ /$1.php [L,NC]
anubhava
  • 713,503
  • 59
  • 514
  • 593
  • asked. please check.https://stackoverflow.com/questions/55057276/remove-php-extenssion-from-a-particular-single-page. @anibhava – Sibasankar Bhoi Mar 08 '19 at 05:35