1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to write a .htacess 302 redirect for specific pages

Discussion in 'General Programming Chat' started by bizbez, Oct 6, 2011.

  1. bizbez

    bizbez Registered Member

    Joined:
    Jan 26, 2011
    Messages:
    86
    Likes Received:
    3
    hi all,

    here's a super newbie question....
    i'd like to do 302 redirection for specific pages (if visitor arrives to page A he is 302'd to page B):

    Code:
    for example these pages:
    if a visitor arrives to this page:
    
    http://domain.com/landsys/profit_black/en/
    or
    http://www.domain.com/landsys/profit_black/en/
    he is 302'd to this page:
    
    http://www.domain.com/en/inner.iframe?id=profit-v1
    via .htacess.


    thanks guys!
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,884
    Likes Received:
    1,932
    Code:
    Redirect 302 / http://www.domain.com/en/inner.iframe?id=profit-v1
    Place above .htaccess into /landsys/profit_black/en/
     
    • Thanks Thanks x 1
  3. Frement

    Frement Registered Member

    Joined:
    Sep 26, 2010
    Messages:
    66
    Likes Received:
    22
    Location:
    46696E6C616E64
    Home Page:
    That would redirect the whole site, instead of that, he should do this:

    Code:
    Redirect /landsys/profit_black/en/ http://www.domain.com/en/inner.iframe?id=profit-v1
     
  4. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,884
    Likes Received:
    1,932
    Note:
    Place above .htaccess into /landsys/profit_black/en/

    Placing a .htaccess folder inside of a folder only controls that folder's objects.
     
  5. Frement

    Frement Registered Member

    Joined:
    Sep 26, 2010
    Messages:
    66
    Likes Received:
    22
    Location:
    46696E6C616E64
    Home Page:
    Yeah sorry my bad, didn't read carefully :)