Click here to get back home

What would this .htaccess code be doing?

 HomeNewsGroups | Search | About
 alt.internet.search-engines    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
What would this .htaccess code be doing? Big Bill 05-24-2008
Posted by Big Bill on May 24, 2008, 1:52 am
Please log in for more thread options
I found this on a site I'm considering...

<Files 403.shtml>
order allow,deny
allow from all
</Files>

what is it likely to be doing, do we think?
It has dubious provenance so it may be crap.

BB
--

http://www.kruse.co.uk/
http://www.fat-odin.com/
http://www.here-be-posters.co.uk/

Posted by Guy Macon on May 24, 2008, 4:28 am
Please log in for more thread options



Big Bill wrote:
>
>I found this on a site I'm considering...
>
><Files 403.shtml>
>order allow,deny
>allow from all
></Files>
>
>what is it likely to be doing, do we think?
>It has dubious provenance so it may be crap.

It is invoking the apache module mod_access to control access
to a particular file.

> <Files 403.shtml>

This says "apply everything between this and </Files>
to one file named 403.shtml. From the filename I am
guessing it is the file that is served up with an
error 403
See http://httpd.apache.org/docs/1.3/mod/core.html#files

> order allow,deny

This sets the order in which the directives that follow are
applied. First, all Allow directives are evaluated at least
one (in this case there is only one; see next line) must
match or access to the file is denied. Next, all Deny
directives are evaluated. if one or more matches (this won't
happen in this case, because there are no Deny directives)
access to the file is denied. Finally, anything that does
not match an Allow or a Deny directive has access denied by
default.
See http://httpd.apache.org/docs/1.3/mod/mod_access.html#order

> allow from all

This says that the Allow directive matches any domain and any
IP address
See http://httpd.apache.org/docs/1.3/mod/mod_access.html#allow

> </Files>

End of invoking the apache module mod_access.

So what the whole thing is saying is "allow anyone to access the
file named 403.shtml"

403 is the HTTP status for "Forbidden", meaning that the client
was able to communicate with the server, but the server is refusing
access to whatever was requested. So if the server denies all
access to. say, a particular IP address, this should see an exeption
for the one error file that is served up along with the error.

I would have to test to make sure that this really does have
priority over the blocking directive. It may be important
which comes first.


--
Guy Macon
<http://www.guymacon.com/>


Posted by Big Bill on May 24, 2008, 6:09 am
Please log in for more thread options
On Sat, 24 May 2008 08:28:17 +0000, Guy Macon
<http://www.guymacon.com/> wrote:

>
>
>
>Big Bill wrote:
>>
>>I found this on a site I'm considering...
>>
>><Files 403.shtml>
>>order allow,deny
>>allow from all
>></Files>
>>
>>what is it likely to be doing, do we think?
>>It has dubious provenance so it may be crap.
>
>It is invoking the apache module mod_access to control access
>to a particular file.
>
>> <Files 403.shtml>
>
>This says "apply everything between this and </Files>
>to one file named 403.shtml. From the filename I am
>guessing it is the file that is served up with an
>error 403
>See http://httpd.apache.org/docs/1.3/mod/core.html#files
>
>> order allow,deny
>
>This sets the order in which the directives that follow are
>applied. First, all Allow directives are evaluated at least
>one (in this case there is only one; see next line) must
>match or access to the file is denied. Next, all Deny
>directives are evaluated. if one or more matches (this won't
>happen in this case, because there are no Deny directives)
>access to the file is denied. Finally, anything that does
>not match an Allow or a Deny directive has access denied by
>default.
>See http://httpd.apache.org/docs/1.3/mod/mod_access.html#order
>
>> allow from all
>
>This says that the Allow directive matches any domain and any
>IP address
>See http://httpd.apache.org/docs/1.3/mod/mod_access.html#allow
>
>> </Files>
>
>End of invoking the apache module mod_access.
>
>So what the whole thing is saying is "allow anyone to access the
>file named 403.shtml"
>
>403 is the HTTP status for "Forbidden", meaning that the client
>was able to communicate with the server, but the server is refusing
>access to whatever was requested. So if the server denies all
>access to. say, a particular IP address, this should see an exeption
>for the one error file that is served up along with the error.
>
>I would have to test to make sure that this really does have
>priority over the blocking directive. It may be important
>which comes first.

I have no idea what you said just then. What's that mean in English
please Guy, why would you have something like that in there? You have
to remember that, going by other things, the guy who set this up seems
to have had little idea of what he was doing...

or it could be me misunderstanding it all!

BB
--

http://www.kruse.co.uk/
http://www.fat-odin.com/
http://www.here-be-posters.co.uk/

Posted by Big Bill on May 24, 2008, 6:28 am
Please log in for more thread options

>>I would have to test to make sure that this really does have
>>priority over the blocking directive. It may be important
>>which comes first.
>
>I have no idea what you said just then. What's that mean in English
>please Guy, why would you have something like that in there? You have
>to remember that, going by other things, the guy who set this up seems
>to have had little idea of what he was doing...
>
>or it could be me misunderstanding it all!
>
>BB

Looking up the background for 403 errors, the site has recently
switched servers. If I understand it correctly, perhaps that's why
it's there, to stop somewone hitting the back button and going back to
where the site used to be on the old server. Or not, as it isn't there
any more.

BB
--

http://www.kruse.co.uk/
http://www.fat-odin.com/
http://www.here-be-posters.co.uk/

Posted by Guy Macon on May 24, 2008, 2:55 pm
Please log in for more thread options



Big Bill wrote:

>Looking up the background for 403 errors, the site has recently
>switched servers. If I understand it correctly, perhaps that's why
>it's there, to stop somewone hitting the back button and going back to
>where the site used to be on the old server. Or not, as it isn't there
>any more.

Nope. That's not what it is there for. See my other post
for a plain english explanation.

>Those lines as submitted are what's there. I don't think they
>should be.

Here is how to test whether they should be there.

First, tell the server to block your IP address[1].
http://www.google.com/search?q=block+user+.htaccess

Second, use your browser to try to access the web site.

Do you get the contents of 403.shtml instead?

Now remove those lines from .htaccess.

Second, use your browser to try to access the web site.

Do you still get the contents of 403.shtml instead?

Note [1]: Don't get into a situation where you access
the .htaccess file to block yourself and then cannot
access the .htaccess file to unblock yourself because
you are blocked. To get around this, you need to be
able to access the site from another IP address.


--
Guy Macon
<http://www.guymacon.com/>


Similar ThreadsPosted
invisible .htaccess March 25, 2005, 8:39 pm
OT ish... .htaccess stuff March 2, 2007, 10:23 am
Yet Another .htaccess Post June 26, 2008, 6:38 pm
Trying to locate my ".htaccess" file... February 16, 2005, 1:51 pm
rewriting URLs for SEO with .htaccess August 1, 2005, 9:54 am
.htaccess config problem December 2, 2005, 1:21 pm
.htaccess redirection and google SE January 9, 2006, 4:45 am
can you "comment out" in an .htaccess file? September 18, 2006, 3:16 am
Commenting out .htaccess instructions January 3, 2007, 10:46 am
SEO-Friendly .htaccess redirects June 23, 2008, 4:34 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap