Redirect help

Discussion in 'Site & Server Administration' started by GeneralOJB, Mar 25, 2011.

  1. #1
    Ok, Simply:

    I want domain.com/1/ to direct to domain.com/2/

    but also domain.com/1/subdir.php to redirect to domain.com/2/subdir.php

    and domain.com/1/blah.jpg to redirect to domain.com/2/blah.jpg

    So on and so forth.

    I'd be very greatful if you could help me.
     
    GeneralOJB, Mar 25, 2011 IP
  2. GeneralOJB

    GeneralOJB Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    thank you...
     
    GeneralOJB, Mar 26, 2011 IP
  3. vinoth.t

    vinoth.t Peon

    Messages:
    156
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just add the below code in your .htaccess file.
    RewriteRule ^domain.com/1/(.*) http://domain.com/2/$1 [L,R=301] 
    Code (markup):
     
    vinoth.t, Mar 26, 2011 IP