301 Redirect Problem

Discussion in 'HTML & Website Design' started by tf8252, Jun 29, 2007.

  1. #1
    I have a 301 Redirect using the following code:
    ----------------------------
    [ISAPI_Rewrite]

    RewriteCond Host: (www\.)?massageclients\.com
    RewriteRule (.*) http\://www.massagelaunch\.com$1 [I,RP]
    -----------------------------


    This works pefectly from some PCs (megaproxy.com)
    but from other places it goes to this bad url "http://www.massagelaunch.comwww./"

    any idea what's adding the "www./" at the end??

    :confused:
     
    tf8252, Jun 29, 2007 IP
  2. zisto

    zisto Guest

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That stupid ISAPI_Rewrite tool you are using messes up Rule backreferences with Cond backreferences. So backreference $1 appends the text "www." matched by group (www\.) in your condition regex, instead of the url matched by group (.*) in your rule regex.

    You better use IIS Mod-Rewrite ( http://www.micronovae.com/ModRewrite/ModRewrite.html ) which is a very serious and stabile rewrite solution for IIS. It's absolutely compatible with apache mod_rewrite and it won't ever cause you such problems.

    Your script, regardless of using it with apache mod_rewrite or IIS Mod-Rewrite, should be written as below:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?massageclients\.com$
    RewriteRule (.*) http://www.massagelaunch.com$1 [NC,R=301]
     
    zisto, Jun 29, 2007 IP
  3. tf8252

    tf8252 Member

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    I can't install that product because it's not my server...I'm using appliedi.net

    :(
     
    tf8252, Jun 29, 2007 IP
  4. Aligit

    Aligit Peon

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    that must suck
     
    Aligit, Jun 30, 2007 IP