inaccessible subdirectories -- htaccess NOT working

Web hosting discussion, programming, and shared and dedicated servers.
4 posts Page 1 of 1
by Sonia » Thu Jun 21, 2012 10:05 am
Sonic hosts my website. I create subdirectories under my website name, load large files to the subdirectories, and send my clients a link to the location of the file (of course, I delete the files from Sonic's server once the client has downloaded them). Been doing this since the days of dial up. Aware it's not secure, as in no password required, but have never had a problem. Suppose I should learn how to set up an ftp site, or passwords for directory access, but that's another topic. Fix what's broken first!

I understand that this ability has been deactivated for security reasons. However, I very much need this ability.

I created a file called "index.htaccess" containing the following text: Options +Indexes and placed it in two places on the Sonic server:

nfs > WWW_pages > username > website

AND

nfs > WWW_pages > username

I still cannot access my subdirectories -- 403 Forbidden error.

There is an index.html file in the website subdirectory, as well as a robot.txt file. Just checked the robot.txt file which is way out of date and deleted it. Could that have been the problem with why the indexing didn't happen yesterday? Or, what is the problem?

Urgently appreciate help. This is all more than I want to know, I'm sorry to say, but I really need it to work the way it used to.

Sonia
by sonia » Thu Jun 21, 2012 10:40 am
Upon advice of a friend, I renamed the "index.htaccess" file to just ".htaccess" PLUS deleted the robot.txt file, and unfortunately didn't test between the two actions, so don't know which one worked, but something did.

All is well!

Yipppeeeeeeeee!

Sonia
by joemuller » Thu Jun 21, 2012 11:13 am
You only need to make sure the file .htaccess (it's really named that way) is either at the base of your web directory (/home/WWW_pages/username/website) or the subdirectory you'd like to change behavior for. The files apply in hierarchical order (top-down), so you can put it as close or far from the directory you'd like to control access to.

If you'd like a bit of extra security, I recommend dropping a .htaccess with just the 'Options +Indexes' in each of the folders that you'd like to have files listed for download.

As a side note, the difference between .htaccess and robots.txt is in how they are applied - a .htaccess file is handled on the server side, but a robots.txt file is more like a browser cookie - most search engines and web crawlers will respect it, but there's nothing to enforce that behavior.
I'm a proud employee of Sonic.net! :-)
by Sonia » Thu Jun 21, 2012 6:17 pm
Thanks, Joe, so much. I've moved the .htaccess file just to the directories I want to index, and it worked great.

Appreciate it!

Sonia
4 posts Page 1 of 1