Forum Moderators: phranque
filename.aspx and they will just work (you might need to add an AddType .aspx text/html {check Apache site for exact syntax} directive in the .htaccess file). href="/otherpagename.aspx" etc. default.aspx and then linked in the site navigation as href="/" not using the actual file name. .htaccess file (assuming you use Apache hosting): DirectoryIndex default.aspx RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*default\.aspx\ HTTP
RewriteRule ^(([^/]+/)*)default\.aspx$ http://www.example.com/$1? [R=301,L]
# Redirect non-canonical requests to www
[code]RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L] .html extension. href="/otherpagename.aspx" etc. index.html and then linked in the site navigation as href="/" not using the actual file name. .htaccess file: DirectoryIndex index.html RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(default|index)\.(aspx|html?)\ HTTP
RewriteRule ^(([^/]+/)*)(default|index)\.(aspx|html?)$ http://www.example.com/$1? [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*[^/.]+\.html\ HTTP
RewriteRule ^(([^/]+/)*[^/.]+)\.html$ http://www.example.com/$1.aspx [R=301,L] RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteRule ^(([^/]+/)*[^/.]+)\.aspx$ /$1.html [L] [edited by: g1smd at 4:52 pm (utc) on Apr 25, 2012]