INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Problem with .htaccess

Problem with .htaccess

(OP)
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

http://www.domain/images/ 
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

http://www.domain/image/ 
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

http://www.domain/images/ 
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
www.studiosoft.co.uk

RE: Problem with .htaccess

(OP)
I should also mention that this is on shared hosting and I experience the same behaviour from the .htaccess files in the add on domains too.

Keith
www.studiosoft.co.uk

RE: Problem with .htaccess

Quote:

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 'www', 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

RE: Problem with .htaccess

By the way, you may get more assistance asking Apache questions in forum65: Apache: HTTP Server

Chris.

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

RE: Problem with .htaccess

(OP)
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
www.studiosoft.co.uk

RE: Problem with .htaccess

(OP)
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
www.studiosoft.co.uk

RE: Problem with .htaccess

For anyone following this thread, ... it continues at thread65-1739650: .htaccess problem

Chris.

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close