Mobile app version of vmapp.org
Login or Join
Rivera981

: Two stage Apache rewrite not working I had a list of "Redirect permanent path/to/url1 http--//domain2.com/path/to/url2" rules working as a test, but when I attempted to couple them with mod_rewrite

@Rivera981

Posted in: #301Redirect #Apache #ModRewrite #Redirects

I had a list of "Redirect permanent path/to/url1 http--//domain2.com/path/to/url2" rules working as a test, but when I attempted to couple them with mod_rewrite rules to catch non-matching domain1 url paths to direct to http--//domain2.com it all fell apart.

now neither the mod_rewrite rules nor the plain 301 redirects are working.

I've got:


a virtualhosts setup for .../sites-availble/domain1 and another for
domain2, pointing to different root directories in /var/www/
the .htaccess file in the redirect directory with the Redirect
permanent rules
/etc/apache2/httpd.conf setup with the "AllowOverride
FileInfo" rule for the redirect directory containing the .htaccess
file
However, for some reason, the traffic coming in as domain1 is triggering the CMS for domain2 to through an error because domain1 hasn't been set as an alias. But it shouldn't even see the domain1 traffic.


Very confusing and frustrating.

Background and intended process flow:

I am moving content from one CMS to another and simultaneously changing both servers and domains. Many of the urls have been changed so much that I just created a long list of Redirect permanent path/to/url1 http--//domain2.com/path/to/url2 rules and stuck them in a least common denominator (/var/www/domainredirects/) .htaccess faile as is. This file is on the new server and the plan is to initially redirect traffic to the new server's IP from the old server (and later change the name server entries when I know what will happen with domain1) and have the apache virtualhost redirect incoming traffic for domain1 to root directory /var/www/domain1redirect/

From there it should hit the individual rules and then at the bottom catch everything else going to domain1 and forward it to domain2's root page.

I have been trying to test this all by setting /etc/hosts to point domian1 to the IP for domain2's server, with the idea that I can get it all set and then just flip the switch on domain1's original server and the traffic will go through the same process path when it hits domain2's server.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Rivera981

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme