subdomain htaccess redirect ? ? ? Help Please

Discussion in 'Apache' started by locals, May 27, 2009.

  1. #1
    I have recently setup a subdomain using a dedicated ip, however the website with the subdomain is hosted by the root website.

    So if you go to the_correct_subdomain.mysite.com

    you see what is supposed to be there, but

    If you go to subdomain_doesnt_exist.mysite.com it displays the root website

    so how do i redirect it so if the subdomain doesnt exist it redirects to the correct website ?

    Thanks for your help
     
    locals, May 27, 2009 IP
  2. jnugroho73

    jnugroho73 Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^the_correct_subdomain.mysite.com$
    RewriteRule ^.* http://the_correct_subdomain.mysite.com$1 [R=301,L]
    </IfModule>
    Code (markup):
    Good Luck :cool:
     
    jnugroho73, May 28, 2009 IP
  3. locals

    locals Well-Known Member

    Messages:
    1,677
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    153
    #3
    sadly to say it didnt work, but i dont think if there is a way to do it :eek: because the webiste that has the subdomain is not the root host. . ..

    Good thing is I have defied the odds and got Wordpress MU installed on a Godaddy Shared Hosting and it works ! ! ! Oh YEAHH ! ! !
     
    locals, May 28, 2009 IP
  4. jnugroho73

    jnugroho73 Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Congratulation locals :cool:, I am sorry that the code did not help you.
     
    jnugroho73, Jun 3, 2009 IP