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
  • 761,203
  • 64
  • 569
  • 643
Rushit
  • 526
  • 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
  • 761,203
  • 64
  • 569
  • 643
  • 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