I have the following code:
# 301 Redirect Old File
Redirect 301 www.website.com www.website.com/shop
I want the site to automatically redirect anyone visiting http://www.website.com or website.com to http://www.website.com/shop, I can’t get it to work, can anybody help? Thank you.
Use
RedirectMatch:Note that the regex portion does not include (and cannot include) protocol and hostname. The new URL can include protocol and hostname (or it can just begin with
/in Apache >= 2.2.6).Note that
Redirect(not used in the above example) uses prefix matching — any request beginning with the specified path will match.