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!

Problem with .htaccess

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
 
and I experience the same behaviour from the .htaccess files in the add on domains too.
That is because "add on domains" are normally created in the document_root, most commonly public_html symlinked as ' and the root .htaccess affects all folders and sub-folders in the tree equally.

Have you tried with
Options ALL -Indexes

And do any of your rewrite rules affect /image/ or /images/ ?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
By the way, you may get more assistance asking Apache questions in forum65

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks Chris
I am running the .htaccess without any rewrite rules, for testing purposes, to remove them from the equation.
I will repeat the question in the other forum, as you suggest.


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
 
For anyone following this thread, ... it continues at thread65-1739650

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