You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Thomas Schweikle <ts...@gmail.com> on 2016/12/16 15:26:18 UTC

[users@httpd] Trubble with rewrite rules

Hi!

I am redirecting all connections to https:

   RewriteEngine On

   RewriteCond %{HTTPS} !=on
   RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


That is working so far. Now an other thing to do I've moved some
content to an other place and I want users accessing the old place to
be redirected to the new place. I've added:

   RewriteRule ^/xyz/(.*) "/abc/$1" [R,L]


But this does not work at all. My second rule is not touched at all.
Moving the rule up does not help. It is touched now, but does not do
anything ...

What I am doing wrong?


-- 
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Trubble with rewrite rules

Posted by Eric Covener <co...@gmail.com>.
On Fri, Dec 16, 2016 at 10:26 AM, Thomas Schweikle <ts...@gmail.com> wrote:
>    RewriteRule ^/xyz/(.*) "/abc/$1" [R,L]


When this rule was first -- If it's in htaccess, the ^/ will not
match. Your other rule accounts for this by making the leading slash
optional.



-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org