Web Hosting Forums

Results 1 to 2 of 2

This is a discussion on Quick subdomain/htaccess question in the Hosting Talk & Chit-chat forum
Is it possible to have a subdomain use it's own htaccess (rather than that of it's parent domain)? ...

  1. #1
    Loyal Client
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    135

    Quick subdomain/htaccess question

    Is it possible to have a subdomain use it's own htaccess (rather than that of it's parent domain)?

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Yes, any directory in your public_html can have an .htaccess file. The way Apache works is it first looks at the directives set in the main configuration file for your site (httpd.conf, which JPC controls) then it starts walking through your site, starting a public_html and drilling down into each directory in the requet's path, looking for .htaccess files, until it reaches the directory that contains the requested file. As it walks through the directories the deeper level settings overwrite similar settings that may have been set higer up the chain.

    So, basically, if you put an .htaccess file in your subdomain directory you can override any settings from your public_html folder's .htaccess and/or it can apply new settings that aren't relavent to the main site. However, if you set something in the public_html .htaccess file that you don't override in the subdomain's file the subdomain will inherit that setting from public_html.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •