Home Remove .php extesion with .htaccess
Reply: 0

Remove .php extesion with .htaccess

user5367 Published in September 19, 2018, 9:09 am

I am trying to remove my .php when someone visits a gallery on a client site. I found the following code that enables that but my .jpgs display "image cannot be displayed".

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]`

Any recommendations?

share|improve this question
  • 3
    Possible duplicate of How to get rid of .php extension in .htaccess – Mehdi Apr 15 at 18:53

2 Answers 2

active oldest votes
up vote 2 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.281841 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO