A typical redirect is usually done from either:
- The entire website to another website:
Redirect / https://www.example.com/
- Or from one specific path of a website to another location:
Redirect /path http://www.example.com/someother/path
The limitation of Apache’s Redirect directive is that you cannot redirect just the root URL “/”, and nothing after it, to another path or location. As Redirect
matches everything after the given path, whatever follows it, and a redirect from “/” is a redirect of all the website’s URLs.
Use RedirectMatch to redirect the root URL “/” to another sub-directory or URL…
RedirectMatch ^/$ http://www.example.com/another/path
Since RedirectMatch
uses a regex, it can be specific with the “/” path without matching anything more.