Mod_Rewrite 301 Redirect Dynamic URLs Problems!

Discussion in 'Apache' started by millworx, Jan 22, 2009.

  1. #1
    So I have a domain that was indexed more heavily than my main domain, on accident, it has 24k pages indexed that gets traffic! Problem is... the domain wasn't supposed to be indexed, i dont even know how there are no links to it at all!

    But anyways.

    I tryed 301 redirecting the whole domain to the main domain.

    Problem is my dynamic link structure looks like this

    http://www.newdomain.com/services.php?st=ca&city=irvine&services=pink%20widgets
    Code (markup):
    Now the problem is MOD_REWRITE is reading the URL and rewriting the %20 as

    http://www.newdomain.com//services.php?st=ca&city=irvine&services=pink%25%20widgets
    Code (markup):
    This is a problem!

    This is my mod rewrite rule

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

    What is up? Why does it rewrite the domains so funky? and whats with the extra slash in the domain?
     
    millworx, Jan 22, 2009 IP