1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

301 question..

Discussion in 'Apache' started by clasione, Apr 30, 2005.

  1. #1
    Does anyone know how to use a rewrite rule to not only send root traffic like this:
    Redirect permanent / http://www.courtforum.com

    but to REWRITE any and all old long urls to the new domain root.....


    something like - rewrite: /index/cfm?toy=tururejf / http://www.courtforum.com

    or

    something like - rewrite: /*
     
    clasione, Apr 30, 2005 IP
  2. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    All you really need is:
    
    RewriteRule ^(.*) http://www.yourNewDomain.com/$1 [R=301]
    
    Code (markup):
     
    nullbit, Apr 30, 2005 IP
  3. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #3

    thanks Nully! :)
     
    clasione, Apr 30, 2005 IP
  4. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ahhh! Don't call me nully!

    No problem, though. :)
     
    nullbit, Apr 30, 2005 IP
  5. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #5
    clasione, Apr 30, 2005 IP
  6. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Where did you put the .htaccess file, in your root directory?

    Also, did you possibly miss the forward slash:
    
    RewriteRule ^(.*) http://www.yourNewDomain.com[b]/[/b]$1 [R=301]
    
    Code (markup):
    Since I get redirected to courtforum.comlearn, which would suggest so.
     
    nullbit, Apr 30, 2005 IP
  7. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #7
    yep - in the root.....

    RewriteRule ^(.*) http://www.courtforum.com/$1 [R=301]

    Redirect permanent / http://www.courtforum.com

    bottom one is working - top on is not...
     
    clasione, Apr 30, 2005 IP
  8. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I just tested my original suggestion on localhost, it does work.
     
    nullbit, Apr 30, 2005 IP
  9. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #9
    There is not much room for error....

    this is in .htaccess which is in the root.... Could it be a server setting?


    Linux Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.11 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
     
    clasione, Apr 30, 2005 IP
  10. nullbit

    nullbit Peon

    Messages:
    489
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I'm not sure, older versions of Apache/mod_rewrite have subtle differences. Some of the examples on this page, might help you further.
     
    nullbit, Apr 30, 2005 IP
  11. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #11
    clasione, Apr 30, 2005 IP
  12. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #12
    I wound up have to use a regular 301, then a 404 page on the new site with a metarefresh to the home page....
    I couldn't get the deep file rewrite crap to work for some reason.

    what do you think of the sufolders redirecting to the homeoage, (forumhome) through a 404 meta refresh?
     
    clasione, May 1, 2005 IP
  13. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #13
    I had these two (2) laying around. You might give 'em a try. ;)

    RewriteEngine On 
    RewriteRule ^(.*)$ http://www.courtforum.com/$1 [L,R=301]
    
    Code (markup):
     
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.com [NC]
    RewriteRule ^(.*)$ http://domain2.com/$1 [R=301,L]
    
    Code (markup):
     
    ResaleBroker, May 1, 2005 IP