Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !\.php$
RewriteRule ^(.+)$ $1.php
You may also want to add additional exclusions so that image files, CSS, and special files like robots.txt are not rewritten, or use the more general solution:
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !(\.¦/$)
RewriteRule ^(.+)$ $1.php
Jim
Also, that script ends everything (and I mean everything) with a .php extension. So then an www.domain.com/image.gif becomes www.domain.com/image.gif.php
Also, that script ends everything (and I mean everything) with a .php extension. So then an www.domain.com/image.gif becomes www.domain.com/image.gif.php
but jdMorgan did say
You may also want to add additional exclusions so that image files, CSS, and special files like robots.txt are not rewritten
for example, if you add this to your rewrite condition (replace ¦ with solid line ; this forum automatically changes them)
(jpe?g¦gif¦png¦js¦css)
it would exclude jpg, jpeg, gif and png image files, as well as java script and css files (or more precisely files that end in those extensions)
I would higly recommend that you read this forum library [webmasterworld.com] as well as Apache url rewrite guide [httpd.apache.org]
HTH