httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Mak <po...@verysmall.org>
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 ^(.*)$ https://www.leicashop.com/$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.

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