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 23:37:55 GMT

>  I have changed the rule to
> 
> RewriteEngine On
> RewriteCond %{SERVER_PORT} =80
> RewriteRule ^/teachers/(.*)$ https://%{HTTP_HOST}/$1 [L,R]
> 
> which does not work either. If I change ^/teachers/(.*)$ to ^(.*)$, it
> works for every page. But I only wanted it to change when entering the
> teachers page.
>  Clearly, then, I still have the regex wrong.
>  What is the correct way to achieve the redirection?

What if you move /teachers/ into the RewriteCond?

Like -

RewriteCond %{SERVER_PORT} 80
RewirteCond %{REQUEST_URI} /teachers/
RewriteRule ...

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