Page is a not externally linkable
jdMorgan - 3:22 pm on Nov 16, 2010 (gmt 0)
Note that literal spaces in the regular-expressions patterns should be escaped to avoid ambiguity.
In a server config file, outside of any <Directory> sections:
Options +FollowSymLinks -MultiViews
RewriteEngine on
#
RewriteRule ^/folio\.html$ http://www.example.com/Showcase.htm [R=301,L]
RewriteRule ^/Residential\.html$ http://www.example.com/Stones.htm [R=301,L]
- or -
In a .htaccess file, or within a <Directory> section in a server config file:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /
#
RewriteRule ^folio\.html$ http://www.example.com/Showcase.htm [R=301,L]
RewriteRule ^Residential\.html$ http://www.example.com/Stones.htm [R=301,L]
It is also generally recommended that all URLs be specified as all-lowercase, to make URL canonicalization possible without having to resort to scripted solutions or to solutions which require CPU-intensive 'file-exists' checks.
Yes, mixed-case URLs can "look more attractive," but can lead to *major* headaches if people link to mis-cased URLs; If the correct URLs are always all-lowercase, this problem can be easily fixed simply by rewriting the mis-cased URL requests to all-lowercase. If the correct URLs are mixed-case, then the filesystem must first be searched to determine the correct casing, which is expensive in terms of server performance, and may be almost impossible without using a scripted approach to determine the 'most likely correctly-cased URL.' Certain combinations of URL-rewriting and mixed-case URL usage may in fact make this impossible to do, leading to lost business opportunity due to the visitors receiving 404-Not Found errors from mis-cased links.
Jim