.htaccess redirect based on requested domain
Posted on April 28, 2008
Imagine you have a selection of domain names that point to the same site, are some of those domains specific to certain areas of your site?
Here's how I redirect a domain name to a specific area on a site
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?cubecartexperts.co.uk
Rewriterule ^(.*)$ http://www.i9000networks.com/landing-page/cubecart-experts/ [L]
You'll also need the domain set in your virtualhost config like this
ServerName www.i9000networks.com ServerAlias www.cubecartexperts.co.uk ServerAlias cubecartexperts.co.uk
It is a much more helpful way of helping your users navigate your site.
Related posts
- Redirect a www prefixed site to a non-www prefix
I like clean URLs. Add this to your .htaccess in the site root RewriteEngine on... - Apache redirects based on IP Address/Subnet
Ever needed to redirect a source IP address or source subnet in apache? Why? Redirect... - New domains
I've just managed to snap up two super new domain names, can't believe they haven't... - Synchronizing time on a Windows 2003 domain controller
In a Windows domain environment its incredibly important that all clients & servers share the... - [Snippet] Forcing Replication Between Domain Controllers
...because some people still don't know! Open Active Directory Sites and Services. In the console...


