Forum Moderators: phranque
but with no luck - i am using
RewriteCond Host: (?:www\.)?example\.co\.uk
RewriteRule (.*) http\://www\.example\.co\.uk/section/new\.aspx$1 [I,RP,L]
thanks
[edited by: jdMorgan at 12:52 pm (utc) on Sep. 25, 2007]
[edit reason] example.co.uk [/edit]
On Apache, a solution would be:
# Redirect http://example.co.uk/<xyz> or https://example.co.uk/<xyz> [b]-OR-[/b]
RewriteCond %{HTTP_HOST} ^example\.co\.uk [OR]
# Redirect htt[b]ps[/b]://[b]www.[/b]example.co.uk/<xyz>
RewriteCond %{SERVER_PORT}<->%{HTTP_HOST} ^443<->www\.example.co\.uk
# to http://www.example.co.uk/section/new\.aspx?page=<xyz>
RewriteRule (.*) http://www.example.co.uk/section/new\.aspx?page=$1 [R=301,L]
This code assumes that all protocol and domain variants resolve to the same directory -- the directory where this code is installed in .htaccess.
Also, I wasn't sure what you intended to do with the requested URL-path -- the "page" path, that is. I attached it as a query string name/value pair, "page=<xyz>", just for an example.
Jim
a typical example of something my redirect file is:
RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.co\.uk/mysite/s1Home\.aspx$1 [I,RP]
so i dont think
RewriteCond %{HTTP_HOST} ^example\.co\.uk [OR]
is the correct syntax
i just tried
# Redirect http://example.co.uk/<xyz> or [example.co.uk...] -OR-
RewriteCond Host: ^example\.co\.uk [OR]
# Redirect [example.co.uk...]
RewriteCond SERVER_PORT<->HTTP_HOST ^443<->www\.example.co\.uk
# to http://www.example.co.uk/section/new\.iVillageHome?page=<xyz>
RewriteRule (.*) http://www.example.co.uk/iVillage/iVillageHome\.aspx?page=$1 [R=301,L]
[edited by: jdMorgan at 12:50 pm (utc) on Sep. 25, 2007]
[edit reason] example.com [/edit]