Mod_Rewrite URL?
Htaccess, Mod_Rewrite February 16th, 2009http://www.whatever.com/linksNot
http://www.whatever.com/links.html
Please, be VERY detailed.
Create .htaccess file in your root directory (note, that there is no file name, than there is a dot, and htaccess is the file extension). If you have an .htaccess file already in your directory just paste this in:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1.html [L,QSA]
That would change whatever.com/links.html to whatever.com/links/.
RewriteEngine On turns the rewrite engine on.
RewriteCond %{REQUEST_FILENAME} !-f – if requested filename is not an exisitng file…
RewriteCond %{REQUEST_FILENAME} !-d – and if requested filename is not an exisitng directory…
RewriteRule ^(.*)/$ $1.html – catch everything before the trailing slash into the variable $1 and replace filename with $1.html.
L – this rule is last.
QSA = Query String Appended (“pass through” existing query strings).