Forum Moderators: phranque
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ /$1.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php if we're so concerned about file system reads, then we probably shouldn't be using htaccess files at all
seems to me the file name extension should disappear once it's on the server.
[edited by: incrediBILL at 7:27 am (utc) on Jan 4, 2014]
I loaded the files on my server (they are all in the same directory including the htaccess) but when I run the mouse over the URLs it shows up with the extension on the file (other items in htaccess are working). Is this correct? seems to me the file name extension should disappear once it's on the server.
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ /$1.php [L,QSA]
I don't have the RewriteBase set, don't remember why
RewriteBase /
RewriteRule blahblah target.php RewriteRule blahblah /target.php I don't have a server on my computer. I loaded the files to my website in a folder to test them. the site isn't live yet.
I'm confused by some of the comments above and not sure they are related to my typo or not. Can someone please clarify as to what I should change.
RewriteRule ^(([^./]+/)*[^./])$ /$1.html [L] Are you saying I have to set up a pseudo-server before this will work
I tried it already, then I can't work on the pages on my computer.
Do they have to come off in order to work? I tried it already, then I can't work on the pages on my computer.