How to redirect domain.com to domain.com/subdirectory/ just like mediawiki does

Discussion in 'Apache' started by glasshoper, Aug 22, 2007.

  1. #1
    i have noticed when you go to mediawiki.org it automatically redirects you to the http://www.mediawiki.org/wiki/MediaWiki. how do they do it? through htaccess? or something else? thank you very much.
     
    glasshoper, Aug 22, 2007 IP
  2. adultuserbars

    adultuserbars Peon

    Messages:
    762
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I assume you are running a Wiki as your site? If so try short URLs from the MediaWiki website.
     
    adultuserbars, Aug 23, 2007 IP
  3. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Yes, you could do it with htaccess. 301 redirect.
     
    Camay123, Aug 29, 2007 IP
  4. tim4444

    tim4444 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    MediaWiki uses PHP's header() routine to generate a custom 301 response. The key field in the header is Location which specifies the new URL.
     
    tim4444, Sep 28, 2007 IP