Problem with .htaccess and subdomain

Discussion in 'Apache' started by ameran, Nov 10, 2007.

  1. #1
    Hello,

    I have a hosting account by hostmonster. You can have more than one domain hosted over there. When you want to install a new website with your new domain, you have to create an addon domain with your new domain into your main domain. I did all of them, but when I upload my script into my directory (/home/user/public_html/new-domain) (this path is just a sample), then I get the 500 error message. I contact hostmonster and they told me:
    because an addon domain is like a subdomain, I have to fix my .htaccess file, but they didn't give me any clue, what I have to do with that file.

    I hope someone here by DP can help me with that.

    I appreciate that,
    ameran
     
    ameran, Nov 10, 2007 IP
  2. indianseller

    indianseller Banned

    Messages:
    372
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i have the same problem with htaccess while whieinstalling on php server
     
    indianseller, Nov 10, 2007 IP
  3. ameran

    ameran Well-Known Member

    Messages:
    1,104
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    150
    #3
    I tried to search in Google but I could not find naything helpfull. Hopefully someone here in DP has a good answer for us.
     
    ameran, Nov 10, 2007 IP
  4. ameran

    ameran Well-Known Member

    Messages:
    1,104
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    150
    #4
    Hi,

    I tried to play with code and reading about .htaccess in internet, then I could fix it.

    This is how I could get my subdomain running. Add this code to your .htaccess in your root directory:

    # wiki subdomain
    RewriteCond %{HTTP_HOST} wiki.domain.com
    RewriteCond %{REQUEST_URI} !wiki/
    RewriteRule ^(.*)$ wiki/$1 [L]



    and then add this code to the .htaccess in the directory you want to exclude (the subdomain dir):
    (Make a new .htaccess file if you don´t have it in your subdomain dir and then add this code to it)


    RewriteEngine Off
    <Files /wiki>
    ForceType application/x-httpd-php
    </Files>


    Regards,
    ameran
     
    ameran, Nov 13, 2007 IP