Redirect Server Alias to Parent Domain

2 posts / 0 new
Last post
#1 Sat, 08/08/2009 - 04:07
tuaris

Redirect Server Alias to Parent Domain

When creating an alias for a Top-level server or Sub-server, I'd like to have a check box under "IP Address and Forwarding" that sets up an Apache mod_rerwite directive to:

"Redirect every URL from www.domain1.com to the corresponding URL (keeping the trailing file path intact) on www.domain2.com, when both domains are being pulled from the same directory on the same server, and respecting URL canonicalization issues (www vs. non-www). "

RewriteCond %{HTTP_HOST} !^www\.pacyworld\.com$
RewriteRule (.*) http://www.pacyworld.com$1 [R=301,L]

For example, the alias http://www.pacyworld.net, would redirect to http://www.pacyworld.com while keeping paths (if any).

Thu, 12/17/2009 - 12:48
sgrayban

I like this idea and wouldn't this be a better idea if you could do this on a per-domain setting ? Right now you can only do this global wide unless you make up different templates and I think that is a waste.

Topic locked