0

I am trying to figure out how to remove .php extension from my URL's.

I did have this setup, but recently I redirected my trailing slash URL's to clean URL's without it. i.e http://www.customlogoshop.com/logo-design/ goes to http://www.customlogoshop.com/logo-design.php

But the .php extension URL I do not want. I want it to just be /logo-design

Any help would be great please!

Options -Indexes
Options +FollowSymlinks

<Files .htaccess>
deny from all
</Files>

RewriteEngine on




RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f

RewriteRule ^(.*[^/])/?$ /$1.php [L,R=301]


</IfModule>
Luke Hall
  • 5
  • 1
  • 4
  • 1
    possible duplicate of [Removing the .php extension with mod\_rewrite](http://stackoverflow.com/questions/4908122/removing-the-php-extension-with-mod-rewrite) – Uyghur Lives Matter Sep 13 '15 at 17:49

1 Answers1

0

remove the R=301 flag :

Options -Indexes
Options +FollowSymlinks

<Files .htaccess>
deny from all
</Files>

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/?$ /$1.php [NC,L]
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
  • Does not work - It just enables php, trailing link url and no trailing url. The extension does not get removed and there are now 3 url's – Luke Hall Sep 13 '15 at 21:47