Having asked a long and convoluted question earlier, I now have some code here using RedirectPermanent
that I need help with.
We're merging an old site into the new one, and don't care about mapping all the ancient urls to anywhere on the new site, so all of it should be permanently redirected to a special index.php that will decide if/where to redirect with php.
The exception is one subdomain, it should do the same thing, but to a different index.php.
This is the "pseudo-config" I'm trying to accomplish - slight variations will work, but I can't get it to ignore the full path of the request, and unconditionally go to my choice of index.php with the querystring.
#Subdomain from old site:
#Process querystring from root\oldsite\subdomain\index.php
<VirtualHost *:80>
ServerName subdomain.oldsite.com
RedirectPermanent / http://www.newsite.com/oldsite/subdomain/index.php
</VirtualHost>
#ALL other requests of any kind regardless of path
#Process querystring from root\oldsite\index.php
# Must show www.newsite.com, NOT www.oldsite.com
<VirtualHost *:80>
ServerName oldsite.com
ServerAlias www.oldsite.com
RedirectPermanent / http://www.newsite.com/oldsite/index.php
</VirtualHost>
The DNS has been set so that everything from the old site goes to this server, and these are the first VirtualHost entries in the config file. How do i modify this code to go to the given index.php regardless of the path.
www.oldsite.com ==> www.newsite.com\oldsite\index.php
www.oldsite.com/forum/anything/else ==> www.newsite.com\oldsite\index.php
www.oldsite.com/faq/category/chosen ==> www.newsite.com\oldsite\index.php
www.oldsite.com/about/us/index.php ==> www.newsite.com\oldsite\index.php
subdomain.oldsite.com/anthing ==> www.newsite.com\oldsite\subdomain\index.php