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

Redirecting using htaccess

Discussion in 'XenForo Questions and Support' started by AndreaMarucci, Mar 21, 2011.

  1. AndreaMarucci

    AndreaMarucci Well-Known Member

    My old forum was in the dir www.domain.com/forum and the new one is under forum.domain.com.

    Can someone help me with an htaccess that redirect all the users pointing to www.domain.com/forum (with all the url under this one like http://www.domain.com/forum/threads/xyz) to the new domain?

    I would like also, if possible, to have access to that directory only with my ip address (static one).

    Many thanks
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use this code:

    Code:
    Redirect 301 /forum http://forum.domain.com
    
    That should do it.
     
  3. AndreaMarucci

    AndreaMarucci Well-Known Member

    Could be but I cannot see any reference to my IP address. That way I cannot access the old forum...
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here is additional code to white list your IP:

    Code:
    allow from 123.123.123.123
    deny from all
    
     
  5. AndreaMarucci

    AndreaMarucci Well-Known Member

    Sorry but does not work...
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I just tested it and it worked for me.

    Are you getting any specific errors? What is happening?
     

Share This Page