Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.co\.uk [NC,OR]
RewriteCond %{HTTP_HOST} ^123\.45\.678\.90
RewriteRule (.*) http://www.example.co.uk/$1 [R=301,L] http://123.45.678.90/folder-one/folder-two/key-word.html http://www.example.co.uk/folder-one/show_drink.php?url_filename=key-word http://www.example.co.uk/folder-one/folder-two/key-word.html RewriteCond %{HTTP_HOST} ^example\.co\.uk [NC,OR]
RewriteCond %{ REMOTE_ADDR } ^123\.45\.67\.89
RewriteRule (.*) http://www.example.co.uk/$1 [R=301,L]
# Externally redirect all non-blank non-canonical hostname requests to canonical host
RewriteCond ${HTTP_HOST} !^(www\.example\.co\.uk)?$
RewriteRule ^(.*)$ http://www.example.co.uk/$1 [R=301,L]