I want to write an apache redirect rule to redirect if the provided url contains a particular substring. For example, say a user hits the server with the url http://bloop1.toop.com. I want to redirect them to http://bloop2.toop.com. From looking around online, I wrote a rule something like the following:
RewwriteRule .+bloop1 http://bloop2.toop.com
But that doesn’t work. Any help would be greatly appreciated.
You can also create a DNS CNAME entry to point the bloop1.toop.com subdomain to bloop2.toop.com. This is probably preferable if you are going to see a lot of traffic to that particular subdomain, as it will shift the workload from your webserver to the client’s DNS lookup.