SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Parent .htaccess file affecting sub domains

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    804
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Parent .htaccess file affecting sub domains

    A customer's main domain has this in the .htaccess file and everything works fine:

    AddType application/x-httpd-php .htm .xml .rss

    But it ruins one of their iWeb websites that is located in an add-on domain. The navigational links of this affected site completely go away. But if I remove the line from the parent domain account, the links work fine. Then I tried adding this into the .htaccess file for the sub site:

    AddType application/x-httpd-php .htm

    I saved changes, cleared the cache and reloaded the page. Still the navigational links in the iWeb site are missing. Does anyone have any ideas on what I should try next?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Hosting Advisor silver trophybronze trophy
    SitePoint Award Recipient cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    2,954
    Mentioned
    49 Post(s)
    Tagged
    0 Thread(s)
    http://www.go4expert.com/forums/showthread.php?t=19545

    The following thread may help you.

  3. #3
    Twitter: @TimIgoe silver trophy
    TimIgoe's Avatar
    Join Date
    Feb 2005
    Location
    Blackpool, UK
    Posts
    1,027
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Apache looks for .htaccess files up the folder tree from the current one, back. If it finds one, rules it finds do apply.

    It sounds like that is whats happening, I'm assuming your main site is in a folder like public_html and then the extra domain is public_html/domain2 - so anything set in public_html applies to all sub domains too.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,343
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    Tim,

    Actually, it's the other way around. Apache looks at the .htaccess files in order from the DocumentRoot through the path to the requested directory. That way, a DocumentRoot .htaccess directive ALWAYS takes precedence as it's parsed first.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    804
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is there any way to over-ride this?
    Convert your dollars into silver coins. www.convert2silver.com

  6. #6
    Do. Or do not. There is no try silver trophy
    SitePoint Award Recipient ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,395
    Mentioned
    88 Post(s)
    Tagged
    2 Thread(s)
    Have you tried AddType text/html .htm in the .htaccess in the subdirectory? That should tell Apache to serve .htm files as plain old html.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

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
  •