need help with htaccess and redirect

Discussion in 'Apache' started by kinslayer1, Jun 22, 2012.

  1. #1
    i am trying to redirect www.domain1.com to the index of www.domain2.com. i am trying to redirect every possible domain1 url , even urls that don't exist.

    domain1 is an empty site and domain2 is a wordpress site with friendly urls on(if it matters).

    redirection is working but the problem i am having is when i redirect www.domain1.com/?1234590lksdgfslj13 it is going to www.domain2.com/?1234590lksdgfslj13 instead of www.domain2.com

    any help would be appreciated thanks.
     
    kinslayer1, Jun 22, 2012 IP
  2. shacaxD

    shacaxD Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Create .htaccess archive:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^ww w.[FONT=arial]domain1.com[/FONT]$ [NC]
    RewriteRule ^(.*)$ htt p://ww w.[FONT=arial]domain2.com[/FONT]/ [R=301,L]
    RewriteCond %{HTTP_HOST} ^[FONT=arial]domain1.com[/FONT]$ [NC]
    RewriteRule ^(.*)$ htt p://ww w.[FONT=arial]domain2.com[/FONT]/ [R=301,L]
    Code (markup):

    NOTE: Remove white spaces in links. I can not post links yet.
     
    shacaxD, Jun 22, 2012 IP