Question:

Allowing directory viewing with htaccess file?

by  |  earlier

0 LIKES UnLike

I've had a website posted online for a while now, and the last time I visited it, going directly to the home page showed my entire directory of files (because I had no index.html in my public_html directory).

Recently, however, I've visited the home page and instead of my directory I get a 403 Error, Forbidden to access the page from this server. I haven't changed anything, and I can still see pages that have an index.html file. But I'd like to restore the feature of having the directory visible. I don't even have an htaccess file.

So, how would I go about writing one? I know you have to add Options Indexes to allow directory viewing, but is that all I have to write? No other code is necessary, just create a text file with that single line in it, change the name to .htaccess, and upload it to my public_html file?

 Tags:

   Report

1 ANSWERS


  1. Normally, that's all it would take; however, directory settings can be generated one level up (in the httpd.conf file which is maintained by the host itself, and has the top level settings for hosted websites).

    If the directive "Options Noindexes" has been set on *that* level, the .htaccess you'll make is not going to make a difference, unless the host has allowed for overrides.

    How to find out?

    Simply make the .htaccess file and see what happens.

    If it fails, you can always drop your host a support ticket asking how or what. If all else fails, you can make a "fake" directory index using PHP...

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.