.htaccess to redirect any URL from a domain to a fixed URL on another domain
Posted
by AlexV
on Server Fault
See other posts from Server Fault
or by AlexV
Published on 2010-02-24T20:02:19Z
Indexed on
2010/03/11
18:04 UTC
Read the original article
Hit count: 589
Anyone can help me out with an .htaccess I'm trying to create?
I want to redirect foo.com to foo.ca.
Any URL from foo.com (with or without www and under http or https) will all be redirected to www.foo.ca.
Some examples:
- http://www.foo.com/ --> http://www.foo.ca/ (http + www)
- https://www.foo.com/ --> http://www.foo.ca/ (https + www)
- http://foo.com/bar/ --> http://www.foo.ca/ (http + some url)
- https://foo.com/bar/ --> http://www.foo.ca/ (https + some url)
- http://www.foo.com/bar/ --> http://www.foo.ca/ (http + www + some url)
- https://www.foo.com/bar --> http://www.foo.ca/ (https + www + some url)
Many thanks!
© Server Fault or respective owner