Small problem with .htaccess and a subdomain

Discussion in 'Programming' started by chevchelios, Mar 23, 2010.

  1. #1
    Hi guys, i have a domain (www.site.net) and now i want to make another site on a subdomain (subdomain.site.net).

    In .htaccess i have this:

    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.site\.net
    RewriteRule (.*) http://www.site.net/$1 [L,R=301]

    to redirect site.net to www.site.net

    RewriteCond %{THE_REQUEST} ^.*/index.php
    RewriteRule ^(.*)index.php http://www.site.net [R=301,L]

    to redirect www.site.net/index.php to www.site.net

    2 days ago i created a subdomain and made a small niche site. But i have a problem. When i want to access subdomain.site.net it takes me to site.net/subdomain.
    * in root, i have my main site (the domain) on /public_html/ and the subdomain is in /public_html/subdomain/.
    ** i dont know any function in htaccess

    So, what i want actually is to still use my domain like before (redirecting non www to www and index.php to /) and to use my subdomain properly, not to redirect me and other stuff.

    Cheers ;)

    L.E.: If i type subdomain.site.net/index.php it takes me to www.site.net
    If i type subdomain.site.net/ it takes me to that folder i was taking about above, www.site.net/subdomain/
     
    chevchelios, Mar 23, 2010 IP
  2. chevchelios

    chevchelios Active Member

    Messages:
    116
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Help pls :(
     
    chevchelios, Mar 23, 2010 IP