How to construct a rule that checks if the incoming request is of certain terms, if no, then reroute to other URL?
For example, I have a website my.example.com
. If the incoming URL is my.example.com/login
then it should execute that request. If it's something else (not login
), then the request must be reroute to your.example.com
. For example,
my.example.com/login2
must reroute toyour.example.com/login2
my.example.com/nologin
must reroute toyour.example.com/nologin
my.example.com/getname
must reroute toyour.example.com/getname
And of course, if it's
my.example.com/login
must reroute tomy.example.com/login
How to use RewriteRule and mod_rewrite to achieve this?