Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess in a subfolder?

    Is there a problem with having a .htaccess file in a subfolder rather than in the root?

    I have two exact copies of a .htaccess, one i the root and one in a subfolder. Only the one in the root works.

    I want it to redirect domain/ to domain/entrance.html.

    Thanks for any hints,
    Mz

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeň, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Hmm, I believe there's a directive for this that can be placed in either httpd.conf or in .htaccess. The default, (or at least the setting found on most servers I've worked with), is that .htaccess is on a per-directory basis, where all the .htaccess files are used for a multilevel path. That is, a path like "/yourdirectory/yourcms/cmsmain.php" will engage the .htaccess file first in "/yourdirectory" and then in "/yourdirectory/yourcms".
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but the .htaccess in the subfolder doesn't seem to work?

    Can I obtain what I want in the root .htaccess?

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeň, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    In all probability, yes.


    I think I'll move this over to the server side forums, though. It's certainly not an HTML & CSS question.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, thanks, html & css was just were I felt safe


    Can someone provide me with a recipe?

    thanks,
    Mz

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im running apache 1.3 on win98

    in HTTPD.conf, check these things

    this one controls what options can be changed for a specific directory by a .htaccess file
    Code:
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "D:/program files D/Apache Group/Apache/htdocs">
    
    #some stuff, clipped for readibility
    
    #
    # This controls which options the .htaccess files in directories can
    # override. Can also be "All", or any combination of "Options", "FileInfo", 
    # "AuthConfig", and "Limit"
    #
        AllowOverride All
    
    #more stuff
    
    </Directory>
    this one tells the server what folder specific folders should be called, should be default, but check anyway

    Code:
    AccessFileName .htaccess
    
    #this one just tells not to give .ht* files to clients
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
        Satisfy All
    </Files>
    photoshop too expensive? use the GIMP! www.gimp.org

  • #7
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    could you not just use a META refresh?

    <META HTTP-EQUIV=Refresh CONTENT="1; URL=http://www.SITE.com/entrance.html">

    NOT SUPPORTED ON ALL BROWSERS - but its effective and most people have IE 5+

    Hope it helps

  • #8
    New Coder
    Join Date
    Mar 2005
    Location
    Indiana (USA)
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Code:
    DirectoryIndex entrance.html index.html index.php
    What this does is set the default page for your site ot any of the following. If you just want entrance.html remove the others, or add more if you need.

    Code:
    Redirect / http://www.yoursite.com/entrance.html
    This redirects http://www.yoursite.com to http://www.yoursite.com/entrance.html


    I think those are what you need


  •  

    Posting Permissions

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