Quote:
Originally Posted by acctman
anyone have an example of how to write url file extension
specific rewrite...
http://www.site.com/members.html to http://www.site.com/main
and then remove all extension for all files ending in *.html
http://www.site.com/*.html to http://www.site.com/*
also this needs to work with and without www
my current htaccess
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(ssss\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?ssss\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.ssss\.com$ [NC]
RewriteRule ^(.*)$ http://www.ssss.com/view/%2.html [R=301,L]
RewriteCond %{REQUEST_URI} !^files/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [L]
</IfModule>
|
need more descriptive what you want.
but here is the basis
Quote:
Options +FollowSymLinks
RewriteEngine On
# which do you want?
# make /members.html use /main
RewriteRule ^members.html /main [NC]
# make /main use /members.html
RewriteRule ^main /members.html [NC]
# alias /filename.html to /filename (dont know if you want to redirect the .html to the non or just make it work without
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
|
hope this helps you out somewhat.