Mod rewrite doenst work fully?

Discussion in 'Apache' started by crazyhorse, May 2, 2005.

  1. #1
    I got this mod_rewrite that i use to redirect all my old links to my new forum.

    Somehow it doesnt redirect properly. Instead of that it redirects to http://www.domainname.com/forum/ it redirects to http://domainname.com/forum/ . Anyone knows what could the reason for this.
     
    crazyhorse, May 2, 2005 IP
  2. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I may not be following what you are trying to do, but the statements above will do this - if the Host header does not begin with "www.", redirect the browser to "http: //www. domainname.com/host-name/url". For example, if somebody requests "http: //forums. domainname.com/index.html", they will be redirected to "http: //www. domainname.com/forums/index.html".

    J.D.
     
    J.D., May 2, 2005 IP
  3. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #3
    It looks like you are saying it redirects to www.domain.com/forum/ and then you say, no wait, it redirects to domain.com/forum/.

    It looks like you just don't want www in the URL. If that's it, try

    RewriteRule (.*) http://domainname.com/%1/$1 [R=301,L]

    If that doesn't fix it, post an old URL, and the new URL you want.

    Or are you trying to move it from (.*).domain.com to www.domain.com/forum/$1/
     
    Nintendo, May 3, 2005 IP
  4. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the responses. Yes im trying to move it from (.*).domain.com to www.domain.com .Im using this mod rewrite cuase i still have thousands of old backlinks that i dont want to loose. Its weird cause before i didnt have any problems with this redirection but since i moved to my new host i do. But maybe it has to do with the fact that i just recently changed my dns zone to my new host. I ll give it one more day to resolve fully and then will see if that might be the problem.
     
    crazyhorse, May 3, 2005 IP
  5. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #5
    misread the post, sorry, dont have an answer for you...
     
    ServerUnion, May 6, 2005 IP