You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Arne Jørgensen <ar...@arnested.dk> on 2008/06/06 10:42:49 UTC

[users@httpd] mod_rewrite - ensuring consistency between HTTP_HOST and REQUEST_URI

Hi,

In a project we are trying to do some sanity checking on the URLs before they
hit our CMS.

We would like to make sure that a certain part of our REQUEST_URI matches a
coresponding HTTP_HOST.

For that we have two maps.

One with HTTP_HOST and the URI-part, ie.

  host1.example.com  uriA
  host2.example.com  uriB
  ...

And the other map with the opposite direction:

  uriA  host1.example.com
  uriB  host2.example.com
  ...


We would like to make sure that a URL is always build up like

  http://host1.example.com/something/uriA/

or

  http://host2.example.com/something/uriB/

And if not a URL like

  http://host1.example.com/something/uriB/

should be redirected to

  http://host2.example.com/something/uriB/


Unfortunately we haven't come up with a usable combination of
RewriteRule/-Cond/-Map.

Any hints?

Kind regards,
Arne


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