How to redirect a folder to a subdomain?

Discussion in 'Install/Configuration' started by freemangl, May 21, 2009.

  1. freemangl

    freemangl New Member

    Eg:
    I want to redirect
    www.mydomain.com/wiki/***
    to:
    wiki.mydomain.com/***

    how can I achieve that use .htaccess rewrite rule?

    ps: 303 Redirect Type doesn't work in litespeed :(
    Code:
    Redirect 303 /wiki  http://wiki.mydomain.com
    Last edited: May 21, 2009
  2. auser

    auser Super Moderator

  3. freemangl

    freemangl New Member

    ah, thanks!

    this works:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/wiki
    RewriteRule (.*) http://wiki.mydomain.com [R=303]
  4. mistwang

    mistwang LiteSpeed Staff

    It is better to create a wiki directory and put Rewrite rule or redirect directive in .htaccess under that directory.
    The performance is better as the web server do not need to test it against every request, only when a request hitting wiki directory.

Share This Page