Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to have a website structure like this:

example.com/ - homepage
example.com/solutions/ - this will be the solution parent page
example.com/solutions/solution-one - child solution page
example.com/solutions/solution-two- child solution page

I have setup the example.com/solutions/index.html file so it can be opened as a parent page, but is shows me an error You don't have permission to access /solutions/.html on this server.

What is the problem? How can I open the parent directory page? I am just using regular HTML pages; no CMS or anything.

share|improve this question
    
What server are you using (Apache, nginx, IIS)? Do you have a .htaccess file and a server config file, if so can you include their contents? What are the file permissions (including owners and groups) in these directories? Does your server's error log have any additional information? –  Stephen Ostermiller Jun 1 at 11:00

3 Answers 3

If you can SSH into your host log in and check the folder and file permissions on that sub-directory. they should be normal but may have gotten changed inadvertently.

You can use .htaccess to define the default page but it doesn't sound like locating it is the issue here.

Check that you have no other strangely named files. Try deleting everything in the directory other than your index.html and try again. Your server may be trying to default to something else prior to index.html like home.html for example.

share|improve this answer
    
@Dušan Based on the question- this is clearly a permissions issue. It is likely that the permissions were set to the creators username/group and not inherited from the root. Set the permissions of these directories and files to match the permission scheme of the www root directory. –  closetnoc May 27 at 15:26

Oh please dont do it like that! Just use a pretty-url code and you can do whatever you want in php:

RewriteEngine on 
# If it does not exist as a directory 
RewriteCond %{REQUEST_FILENAME} !-d 
# And if it does not exist as a file 
RewriteCond %{REQUEST_FILENAME} !-f 
# Then add .php to get the actual filename 
RewriteRule ^(.*)/? index.php?url=$1 [L]

In index.php $_GET['url'] will now be /solutions/solution-one. You can explode or or do whatever you like with it. This is the way to go, not subdirs with an index.

share|improve this answer
    
I am just using html, no php, or any other programming language. –  Dušan May 27 at 9:03
    
They I strongly recommend you find yourself a very basic pages script for php. Just a basic amount of php will save you ten times the time you spend on php in the long run. –  Martijn May 27 at 9:08
    
I just need this for presentation, i am preparing the code for a developer, and he will use what ever he wants...I just need to setup it with current state with just html –  Dušan May 27 at 9:16
    
Ah OK, in that case, @dotit might be right :) –  Martijn May 27 at 9:17

Try to setup "Default page(D)" in the .Htaccess

.htaccess Editor

Example:

DirectoryIndex index.html       
order deny,allow
share|improve this answer
    
i do not see how this can help me, could you provide code example for htaccess file/ –  Dušan May 27 at 9:34
    
@dotit It's always best to add a summary of what the OP and others might find in links in case they don't work anymore; a short excerpt of code is always helpful too. –  dan May 28 at 6:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.