Highlighted

Dispatcher rewrite rule based on the source IP/Domain

preetivardhanb9

19-06-2019

Hi,

I have requirement to redirect the request that is coming to dispatcher (There are only two sources from which the request will come to my dispatcher, lets say they are 1.1.1.1 and 2.2.2.2) Dispatcher should render page1 if the request is from abc.com and page2 if the request is from xyz.com.

I have a virtual host set for the domain where I have mentioned below rewrite rules, but they are not working.

RewriteCond %{REMOTE_ADDR} 1.1.1.1

RewriteCond %{REQUEST_URI} ^/security/assertionconsumerservice$ [NC]

RewriteRule (.*) /content/client1/login [QSA,R,L]

RewriteCond %{REMOTE_ADDR} 2.2.2.2

RewriteCond %{REQUEST_URI} ^/security/assertionconsumerservice$ [NC]

RewriteRule (.*) /content/client2/login [QSA,R,L]

Could any one please help?

Replies

Highlighted

Jörg_Hoh

Employee

19-06-2019

Are you sure that the correct virtualhost is used? Have you put the statement "RewriteEngine on" in front of these rules?