Domanda

I just new to website develop. I got a simple question as following:

  1. Assuming I have an index.html under: http:www.myWebsite.com/A/B/C/index.html, and I want to people be able to see this page (index.html), however, NOT able to access:
    • myWebsite.com/A/B/C/
    • myWebsite.com/A/B/
    • myWebsite.com/A/
      What sure I do? "
  2. "What if in addition, I have another index.html page under myWebsite.com/A/B/index.html, again I want to people be able to access both of those two pages (under C and under B), but NOT following:
    • myWebsite.com/A/B/C/
    • myWebsite.com/A/B/
    • myWebsite.com/A/
      What sure I do"
  3. In general, what is the access control policy for multi-directory on website?

(By default, my server running on linux, apache, and all files under /var/www/html.)

Thank you!!!!!


Sorry for the confuse. When I mean can NOT see (access), I mean forbidden. What I'm try to say here is, sometimes, if you tpye myWebsite.com/A/B/C/test.html you will see whatever on test.html, however, if you just type myWebsite.com/A/B/C/, you see forbidden message. That's what I mean you can see or cannot see...

È stato utile?

Soluzione

In the site.conf (Normally httpd.conf if you have not changed it.) find the site VirutalHost contanier for the site.

If you see

"DirectoryIndex" delete that line.

IE:

<VirtualHost *:80>
    DocumentRoot /var/www/site/
    ServerName website.com
    ServerAlias www.website.com
    DirectoryIndex index.htm (**REMOVE THIS LINE**)
</VirtualHost>

Also in the httpd.conf look for the line

DirectoryIndex and remove index.htm or whatever else you want to remove.

Thank should do it.

It might be good to also search for index.htm to make sure there are no other instances.

Also make sure you restart apache.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top