How do I know if .htaccess is supported or where to put it?

Discussion in 'Apache' started by whose, Jan 21, 2009.

  1. #1
    I work with a company that insists on using their own server for their various websites and even though their server guy swears up and down that it supports .htaccess and that it should work if I just put it in a folder, every one I have tried has had no response. I even uploaded a .htaccess file with nothing but random characters to try to "break" the site to see if it was reading it and still nothing!

    Does anyone know how else I can check if a server actually supports .htaccess? Or any other ideas on where it may need to be placed. they have their server setup weird (at least to me).

    Any sample, basic starter .htaccess files I could try (all the ones I found are already all coded up and I just need a clean base.

    any help is always appreciated.

    Thanks!
     
    whose, Jan 21, 2009 IP
  2. codecs

    codecs Peon

    Messages:
    198
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can put your .htaccess on the root folder of your server. You can ask it to your who ever host your server or read the FAQ of your hosting. You can search google for sample of .htaccess scripts.
     
    codecs, Jan 21, 2009 IP
  3. bestbeach

    bestbeach Banned

    Messages:
    177
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can put .htaccess in public html on your root folder..what platform do you use?
     
    bestbeach, Jan 21, 2009 IP
  4. drakul

    drakul Active Member

    Messages:
    456
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #4
    drakul, Jan 21, 2009 IP
  5. whose

    whose Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Dug a little deeper and found the httpd.conf file

    The virtual hosts are set up as follows:
    
    <VirtualHost *:80>
       ServerName   website.com
       DocumentRoot "/www/website/docs"
       ScriptAlias  /cgi-bin/ "/www/website/cgi-bin/"
       ErrorDocument 404 /404.php
    </VirtualHost>
    
    Code (markup):
    Noticed that on some there is
    
    <Directory /www/website/docs/subfolder>
       AllowOverride All
    </Directory>
    
    Code (markup):
    Do I need to have the server guys make sure that <Directory> chunk for the domain I want .htaccess for is set to the "/docs folder?

    If so, will it trickle down to subfolders automatically? we have some test folders setup before we relaunch an updated site and we are wanting to 301 redirect the old files to the new one via .htaccess when the time comes.

    Thanks for everyone's help so far.

    @drakul: thanks! Great link, Bookmarked :)
     
    whose, Jan 21, 2009 IP