httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Hufnagel <mirkohufna...@gmail.com>
Subject [users@httpd] Apache URL RewriteCond / RewriteRule question
Date Thu, 29 Jan 2015 21:20:03 GMT
Hello,

My name is Mirko and I have a problem with our RewriteRules.

What I want:

Visitor type the URL www.linart.de
And we forward him to www.linuxart.de/en

That works!

Visitor type the URL www.linart.de/en
And we forward him to www.linuxart.de/en

That works!

Visitor type the URL www.linuxart.de/page1
And we forward him to www.linuxart.de/en/page1

And that's the pain - I have no idear how we can solve that?! What I
produce in my example below produce and endless loop of redirections.

And idear?
Any help would be great!


# --------------
RewriteCond %{HTTP_HOST} ^(www\.)?linart\.de$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/$ http://www.linuxart.de/en/               [R=307,NC,L]

RewriteCond %{HTTP_HOST} ^(www\.)?linart\.de$
RewriteCond %{REQUEST_URI} ^/en$
RewriteRule ^/en$ http://www.linuxart.de/en/             [R=307,NC,L]

#RewriteCond %{HTTP_HOST} ^(www\.)?linart\.de$
#RewriteCond %{REQUEST_URI} ^/en/.+$
#RewriteRule ^/en/(.*)$ http://www.linuxart.de/en/$1      [R=307,NC,L]
# --------------

Mime
View raw message