Hey guys, I have heard loads about changing php extensions into html extensions but I don't know how to change a variable into an html extension... how would i be able to rewrite http://www.sitename.com/?n=running to http://www.sitename.com/running.html If you know, please tell me. Also, if you know how to do this. If I make a link to http://www.sitename.com/running.html will it still show the stuff like I will use the variable running to create the whole page so will it know that the variable $n=running? Thanks.
.htaccess rule: If you don't have them... RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Code (markup): Specific to this problem: RewriteRule ^running\.(html|php)/?$ index.php?n=running [L,NC,QSA] Code (markup): Matches: running.html running.php running.html/ running.php/ Code (markup): Doesn't match: running running/run running.shtml running/folder/subfolder/running.html Code (markup):
So the first code will turn anything into .html? And if I enter the URL as running.html will it load the same content?
First block of code switches on the RewriteEngine and sets the RewriteBase to / (change this as appropriate.) Also stops it matching actual files and directories. (Which is normally what you want, very rare you don't - and certainly not in this case.) Dan