Hi everyone!
I have a little problem with a set of regular expressions that are to
be used in my httpd.conf file for mod_rewrite (Apache 1.3).
My configuration includes the following lines:
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\.domain\.de/[^(de/)].*
RewriteRule ^/(.*)$ /de/$1
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\.domain\.it/[^(it/)].*
RewriteRule ^/(.*)$ /it/$1
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\.domain\.pl/[^(pl/)].*
RewriteRule ^/(.*)$ /pl/$1
What I want to achieve is that files requested via will
be served from documentRoot/de, those requested via from
documentRoot/pl and so on.
This works for .de and .pl however it does not for .it. Is there
anything I overlooked concerning special behaviors of certain
characters?
The log file says
RewriteCond: input='pattern='^www\.domain\.pl/[^(pl/)].*' => matched
10.112.151.237 - - (2) rewrite /index.html -> /pl/index.html
RewriteCond: input='pattern='^www\.domain\.it/[^(it/)].*' => not-matched
I don't really get it.
Could I do this with a more general approach like
RewriteCond %{HTTP_HOST}%{REQUEST_URI}
^www\.domain\.([a-z]{1,3})/[^\1].*
RewriteRule ^/(.*)$ /$1/$2
??
Would be nice if the second thing worked so I did not have to edit the
config file when a new top level domain is introduced. But the first
approach would be totally sufficient, as long as I get this to work
with ".it".
Thanks in advance!
I have a little problem with a set of regular expressions that are to
be used in my httpd.conf file for mod_rewrite (Apache 1.3).
My configuration includes the following lines:
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\.domain\.de/[^(de/)].*
RewriteRule ^/(.*)$ /de/$1
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\.domain\.it/[^(it/)].*
RewriteRule ^/(.*)$ /it/$1
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\.domain\.pl/[^(pl/)].*
RewriteRule ^/(.*)$ /pl/$1
What I want to achieve is that files requested via will
be served from documentRoot/de, those requested via from
documentRoot/pl and so on.
This works for .de and .pl however it does not for .it. Is there
anything I overlooked concerning special behaviors of certain
characters?
The log file says
RewriteCond: input='pattern='^www\.domain\.pl/[^(pl/)].*' => matched
10.112.151.237 - - (2) rewrite /index.html -> /pl/index.html
RewriteCond: input='pattern='^www\.domain\.it/[^(it/)].*' => not-matched
I don't really get it.
Could I do this with a more general approach like
RewriteCond %{HTTP_HOST}%{REQUEST_URI}
^www\.domain\.([a-z]{1,3})/[^\1].*
RewriteRule ^/(.*)$ /$1/$2
??
Would be nice if the second thing worked so I did not have to edit the
config file when a new top level domain is introduced. But the first
approach would be totally sufficient, as long as I get this to work
with ".it".
Thanks in advance!