How to remove .php or .html extension from single page?

.htaccess, apache, mod-rewrite, regex

Solution

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]

Problem

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 ```

Original source