Hello -

On my server, if you go to the document root (mysite.com), it will default to the index.php file as I specified in the httpd.conf file.

The problem is that if you go to a directory beyond the document root (like mysite.com/cool), the index page (mysite.com/cool/index.php) fails to load and I get an Apache error even though index.php exists in that directory. How do I fix this?

Thanks for your time.

    i have no idea why it's doing this, btu you might have to respecify the directive (i forget what it is) in a .htaccess file for each dir....at least that should work, unless, it's unchangeable by a .htaccess........😕

    hth
    moon

      does your line in your httpd.conf look like this

      DirectoryIndex index.html index.html.var index.htm index.php index.php3

      cuz that's all i've ever used

      and make sure to restart apache when making config changes

        Have you checked the permissions??

        Both of the webrootdir and that of the subdir inside it.. also of the .php files...

        If you specify the file, does it work?

        (i mean if you type mysite.com/cool/index.php)

        shrug

          Thanks for the advice so far but no luck. To answer a couple questions, this does work:

          mysite.com/cool/index.php

          and this doesn't:

          mysite.com/cool

          but this does:

          mysite.com/cool/ <- notice the following slash

          Maybe it has always been necessary to add the following slash but I don't remember ever having to do that. Am I crazy or is there something I can to about this?

            is this live somewhere we can see, you shouldn't have to put the trailing slash there, what browser are you using

              it works fine!

              the trailing slash IS required since if u dont add it, the browser gets a FILE 'cool' which does not exist...

              Worry not, all is ok.

                actually, in UNIX based filesystems (to the best of my knowledge) treat directories as just another file, just one with some code in it to make the dir work. that's why directories are always at least 4096K (i think?)
                [edit]
                <----256th post--16th of a dir 😃[/edit]

                  Originally posted by thief_GRR
                  it works fine!

                  the trailing slash IS required since if u dont add it, the browser gets a FILE 'cool' which does not exist...

                  Worry not, all is ok.

                  well i don't think you are correct, i can go to any web address, take www.phpbuilder.com/board for example, this will not give me an error, it will go to www.phpbuilder.com/board/ automatically

                    Ok, here are some links:

                    http://216.73.107.156/cool/index.php
                    http://216.73.107.156/cool/index.html
                    http://216.73.107.156/cool/
                    http://216.73.107.156/cool

                    Notice how the last one doesn't work?

                    index.php and index.html are listed in the httpd.conf file. I also know that I've worked on many other servers and I don't have to use the following / in order for apache to server one of the listed default pages.

                    What's going on here?

                    EDIT: here's a like from my other server where I don't have to add the trailing slash:
                    http://highermedia.com/mark/namibia

                    notice how the slash is added after you hit return in the browser?

                      all the links worked, but the last one doesn't and it is also turning the ip into phillyreview.com for some reason, all the others stay as the ip

                        hmmmm... Well, the last one is the link that I'm working on.

                        Strange that it redirects you, it just throws me one of those "The page connot be displayed" pages.

                          it gives my a page not displayed, but up in the address bar, it shows the philly thing

                            In the address bar it shows me the link I clicked. Why would we get different results? Thanks for your help so far. I'll be sure to let you know if I get this resolved.

                              Ok, sort of figured it out...

                              The reason I'm getting an error without the slash is becuase this site is still being developed and the domain name hasn't been pointed to the IP yet. On all the other sites where the domain name has been pointed to the domain name, it works as long as you use the domain name (not the IP) in the arrress bar. (eg http://www.kering.net/test2 )

                              Anyway, sorry for the confussion and thanks for the help.

                                Write a Reply...