httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Mak <>
Subject Re: [users@httpd] Simple RewriteRule?
Date Mon, 18 Jul 2011 22:57:37 GMT
> Hello,
>  apache v2.2
>  I have what I thought is a simple re-write rule:
> RewriteEngine on
> ReWriteRule ^/teachers/(.*)$ https://${HTTP_HOST}/$1 [L,R]
>  The idea is that if the teachers page is being loaded, always use the
> secure protocol. It does not work.
>  Where have I gone wrong?

I have a working .htaccess which redirects any non-https request over https:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

In your example I do not see the RewriteCond - you need a condition on which the rule to act,
if I am not mistaken.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message