You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Harry Spier <ha...@hotmail.com> on 2007/05/17 06:01:42 UTC
[users@httpd] Overriding url filename changing in Apache
Dear list members,
I have a website on a shared hosting Apache Linux server.
On that server, Apache is set so that if a url is sent to a domain with a
file name that doesn't exist but another filename exists on that domain with
one letter different from the url, it changes the url to the existing file
name and accesses it instead of giving a 404 error. I believe (but I'm not
sure) that this is because mod-speling is enabled on that Apache server.
This is the default behaviior on the shared hosting server and they wont
change it.
I need to override that behavior in my domain so that a url to a
non-existent file will always give a 404 error. (My website is a digital
library of thousands of books where the filenames are a catalogue number. I
can't change the filenames.) Is there anyway I can use my .htaccess file to
override the servers changing the url to a similar file name (which of
course displays the wrong book) and force it to give a 404 error for all
non-existent files.
I've tried adding a statement:
ErrorDocument 404 404err.htm
to my .htaccess (where 404err.htm prints file not found)
But the server still serves up a file with a similar name instead of giving
a 404 error.
Thanks in advance,
Harry Spier
_________________________________________________________________
Like the way Microsoft Office Outlook works? Youll love Windows Live
Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_outlook_0507
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Overriding url filename changing in Apache
Posted by Harry Spier <ha...@hotmail.com>.
Thanks Scott,
That did the trick.
Best,
Harry
Harry Spier
371 Brickman Rd.
Hurleyville, New York
USA 12747
>From: Scott Gifford <sg...@suspectclass.com>
>Reply-To: users@httpd.apache.org
>To: users@httpd.apache.org
>Subject: Re: [users@httpd] Overriding url filename changing in Apache
>Date: Thu, 17 May 2007 01:01:00 -0400
>
>"Harry Spier" <ha...@hotmail.com> writes:
>
> > I have a website on a shared hosting Apache Linux server.
>
>[...]
>
> > I believe (but I'm not sure) that [...] mod-speling is enabled on
> > that Apache server. This is the default behaviior on the shared
> > hosting server and they wont change it.
> >
> > I need to override that behavior in my domain so that a url to a
> > non-existent file will always give a 404 error [...] Is there anyway I
>can
> > use my .htaccess file to override the servers changing the url
>
>According to the docs, you can use the directive:
>
> CheckSpelling off
>
>in your .htaccess file to turn off mod_speling for just the files in
>that directory:
>
> http://httpd.apache.org/docs/2.0/mod/mod_speling.html
>
>Hope this helps!
>
>---Scott.
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
_________________________________________________________________
More photos, more messages, more storageget 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Overriding url filename changing in Apache
Posted by Scott Gifford <sg...@suspectclass.com>.
"Harry Spier" <ha...@hotmail.com> writes:
> I have a website on a shared hosting Apache Linux server.
[...]
> I believe (but I'm not sure) that [...] mod-speling is enabled on
> that Apache server. This is the default behaviior on the shared
> hosting server and they wont change it.
>
> I need to override that behavior in my domain so that a url to a
> non-existent file will always give a 404 error [...] Is there anyway I can
> use my .htaccess file to override the servers changing the url
According to the docs, you can use the directive:
CheckSpelling off
in your .htaccess file to turn off mod_speling for just the files in
that directory:
http://httpd.apache.org/docs/2.0/mod/mod_speling.html
Hope this helps!
---Scott.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org