httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Keltz <...@cs.yorku.ca>
Subject Re: [users@httpd] using mod_rewrite to get around unknown directive in .htaccess
Date Tue, 31 Jan 2006 23:52:22 GMT
On Tue, 31 Jan 2006, Joshua Slive wrote:

> On 1/31/06, Jason Keltz <jas@cs.yorku.ca> wrote:
>> An Apache module is enabled on our 1.3.34 https server, and not on our
>> http server.  The http and https servers serve the same document tree.
>>
>> One .htaccess file in a users web tree (say, ~user/secure/.htaccess)
>> contains directives that will only work on the https server.  When a
>> user visits the page on the http tree, they get an "Internal Server
>> Error" message.  This, I would expect.
>>
>> However, I would like to make it so that when the user tries to view the
>> page VIA http, he is automatically redirected to the https page using
>> mod_rewrite.  Now, the directives in the .htaccess file exist, and
>> everything works.  The problem is that even though I include the rewrite
>> directives in the upper level (~user/.htaccess) file that will may
>> http://server/~user/secure to https://server/~user/secure, the server
>> still tries http://server/~user/secure/.htaccess first, and dies with
>> the internal server error, so it does not end up redirecting.
>>
>> Is there a simple way around this?
>
> Use httpd.conf to turn off .htacess processing (AllowOverride) in the
> relevant directory inside the <VirtualHost> section for the non-ssl
> host.

Hi Joshua,

Unfortunately, this won't do it since multiple users can use the 
directives on the https server in any directory.  Is there no 
"IgnoreErrors" directive in .htaccess?  What I really don't get is that if 
I redefine the error message in the top-level .htaccess, that does indeed 
get read which shows that the server reads the top-level .htaccess before 
reading the bottom-level one.  How come an Error code web page 
redefinition works, but a  mod_rewrite rule does not..

Jas.

---------------------------------------------------------------------
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


Mime
View raw message