OS: Debian ETCH
Hi, Im trying to mix up a little mod_alias and rewrite to make this work:
I need to handle redirections from my old domain, with all his subdomains and files, to a new domain, examples:
http://test.losblogs.cl has to redirect to http://test.losblogs.NET
Then, http://test.losblogs.cl/page/ to http://test.losblogs.NET/page/
http://test.losblogs.cl/script.php to http://test.losblogs.NET/script.php
I have a wildcard DNS because I'm a bloghost, so there are tons of subdomains that have to be redirected from .CL to .NET
My solution so far (I'm a Noob) is doing some alias redirection:
For base domain vhost:
- Code: Select all
RedirectMatch (.*)\$ http://losblogs.net$1
RedirectMatch (.*)\/$ http://losblogs.net$1
RedirectMatch (.*)\.php$ http://losblogs.net$1.php
And rewrite for trailing slash:
- Code: Select all
RewriteRule !^(\..*|/)$ %{REQUEST_URI}/ [R=301,L]
So here is it working:
http://losblogs.cl Will redirect to http://losblogs.net
http://losblogs.cl/soporte will redirect to http://losblogs.net/soporte
http://losblogs.cl/soporte/ will redirect to http://losblogs.net/soporte/
http://losblogs.cl/index.php will redirect to http://losblogs.net/index.php
Now, my problem is to create the same effect on subdomain.losblogs.CL to redirect to subdomain.losblogs.NET, I dont know what to add on the vhost of the wildcard dns.
Thank you so much.