PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
mmm... it looks like both me and superdizign have been trying to solve this problem like rookies
I stoped for a while and made some http requests using command line curl.
It really is trivial.
if http://mysite.com/path is a directory then the server answers a 301 and specifies the Location. Most of the clients will redirect the user to that location.
This means... i have to handle redirections... buuuh... more boring codding ahead.
I hope this thread to be of interest of other people having the same existential questions.
I don't believe it is possible. So many pages are dynamically generated these days. Any front controlled app for instance will direct all requests whether they look like directories or not to a single file. Ultimately though every request goes to a file the one that look like they are going to a directory are actually going to files only the web server configuration is choosing what that file is (usually index.html, index.htm or index.php)
ole wrote:I don't believe it is possible. So many pages are dynamically generated these days. Any front controlled app for instance will direct all requests whether they look like directories or not to a single file. Ultimately though every request goes to a file the one that look like they are going to a directory are actually going to files only the web server configuration is choosing what that file is (usually index.html, index.htm or index.php)
Why do you need to know this?
I wanted to know this in order to follow relative links properly.
It's not really a mater of how the sites are coded, it's more about the http protocol itself and the way webservers inplement it.
The problem is solved though. Read my last post.
Often we browse and even include links on sites like: http://mysite.com/dir when we want to point to http://mysite.com/dir/ . The servers handle this ambiguity by repplying a 301 error code ( permanently moved ) and providing the location. The browsers simply redirect you to the right location.
superdezign wrote:I tried cURL, but I guess you've got better luck than me. I was just looking at the headers after your suggestion that it may be there.
There are way too many CURLOPTs. Makes my head spin.
ehehe... who forgot to read the documentation? .... both of us