Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess problem

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I have an odd problem with a .htaccess file which defies logic and I was hoping someone could suggest a possible reason for the behaviour.
I have cut down the contents for clarity but the problem still persists.
The problem centres around the Options indexes command.

The initial .htaccess file looks like this.


Code:
ErrorDocument 400 /cgi-bin/forbidden.pl?call=400&
ErrorDocument 401 /cgi-bin/forbidden.pl?call=401&
ErrorDocument 403 /cgi-bin/forbidden.pl?call=403&
ErrorDocument 404 /cgi-bin/forbidden.pl?call=404&
ErrorDocument 500 /cgi-bin/forbidden.pl?call=500&
Options +indexes

I call the following URL in a browser

Code:
[URL unfurl="true"]http://www.domain/images/[/URL]
and the browser contains all the images in folder.

I now change the indexes command (to hide the list)


Code:
Options -indexes 
It successfully runs forbidden.pl

Remove the 's' from images (in the address bar)

Code:
[URL unfurl="true"]http://www.domain/image/[/URL]
Displays the standard windows 'The Webpage cannot be found' window rather than running forbidden.pl.

Replace the 's' (return the URL to the previously working one)

Code:
[URL unfurl="true"]http://www.domain/images/[/URL]

Still displays the standard windows 'The Webpage cannot be found' window rather than running forbidden.pl.
I have cleared caches etc. but nothing appears to affect the results.
In the full version, there are quite a few Rewrite rules which work perfectly so the .htaccess file is being processed.
I get this behaviour on all of our computers but when I view the URL through a proxy server it works fine.

Has anyone any thoughts because it is driving me crazy

Keith
 
My ISP has been looking into this and can find nothing wrong.
They have only tested it through a proxy server so whether that makes any difference or not, I am unsure.

I am getting frustrated with the people at the ISP telling me everything is OK. If it was, it would also work on all of our computers and there would not be a problem, right?

Please feel free to test this for yourself on this non commercial site:-

Try the following links.
Do you get OOPS! or the standard windows error screen after each link?

Keith
 
After further experiments I have managed to get this to work.
It would appear that the error document needs to be over a certain file size to work, I have no idea what the threshold is but I added an 87k jpg to the error page and it works as expected.

Keith
 
The minimum file size for error documents is 512bytes if I recall correctly, but that was an abitrary limit imposed by M$ browsers (and IIS) only, and adding an image to a document only increases the document physical size by the length of the <img ... > tag as far as the server is 'aware'. So were you testing in Infernet Exploder by some misfortune? :)

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I was testing in IE as this was the browser used by the person who first reported the problem. Like it or loathe it, IE is a well used browser and we ignore it in favour of one of the trendier browsers at our peril.

Keith
 
I realise that. It's simply that IE's bad behaviour was throwing you in the wrong direction as to where the problem actually lay, with the result of you trying to hunt down a 'server issue' that did not actually exist.

I haven't encountered the "minimum size" problem for so long it wasn't until you posted wnat solution you came up with which reminded me. Twenty years ago it was a common occurence so was something that I tended to do without ever thinking about it, and always had a few hundred bytes of pointless 'footer text' or a LOT of spaces (the advantage being that HTML only displays ONE space regardless of how many there are) in the error document.

A doddle with scripting :) response.write(space(500)) :)

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top