Someone Help me Real fast !! Please

Discussion in 'Apache' started by sundaybrew, Dec 8, 2007.

  1. #1
    I just need to know how to redirect a single url

    from

    /tv/

    To

    Tv.domain.com

    Please let me know how I can do this

    Thanks in advance
     
    sundaybrew, Dec 8, 2007 IP
  2. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    #2
    RewriteEngine On
    
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com/tv [NC]
    RewriteRule /* http://Tv.domain.com [R,L]
    Code (markup):
    Regards
     
    st1905, Dec 8, 2007 IP
    sundaybrew likes this.
  3. sundaybrew

    sundaybrew Numerati

    Messages:
    7,294
    Likes Received:
    1,260
    Best Answers:
    0
    Trophy Points:
    560
    #3
    Right oN!!!

    Thanks sooooooo much and Happy Holidays !!!!!!
     
    sundaybrew, Dec 8, 2007 IP
  4. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    #4
    You`re welcome, i`m glad that i helped you, Happy Holidays you too :)
     
    st1905, Dec 8, 2007 IP
  5. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The more I look at this rewrite rule the more it puzzles me. Translating it into English:

    If the last page the visitor was on was not www.domain.com/tv and the current page contains any number of slashes, redirect them to tv.domain.com

    But what you wanted was:

    If the current page is domain.com/tv then redirect them to tv.domain.com.

    As it stands, the rewrite rule will redirect every visitor you get, even if they are not looking at /tv.

    I would use:
    RewriteRule ^tv/ http://tv.domain.com
    Code (markup):
    and forget about the RewriteCond altogether.
     
    Ladadadada, Dec 8, 2007 IP