301 redirect from folder to subdomain

Discussion in 'Apache' started by mamulea, May 20, 2008.

  1. #1
    Hi guys, I'm trying to permanently redirect all my pages from www.domain.tld/directory to directory.domain.tld. As I dont have a control panel on the hosting server, I created a .htaccess with following lines:

    RewriteCond %{HTTP_HOST} !^directory\.
    RewriteRule ^directory(.*)/?$ http://directory.domain.tld/$1 [L,R=301].


    However, nothing happened after I uploaded this file on the server. Am I doing smth wrong? Pls help. 10x.
     
    mamulea, May 20, 2008 IP
  2. phplife

    phplife Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Silly question, but is the mod rewrite module enabled for your server? Sometimes you need to ask your host to make sure.

    phplife
     
    phplife, May 20, 2008 IP
  3. mamulea

    mamulea Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    of course it is
     
    mamulea, May 21, 2008 IP