Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Dispatcher rewrite rule based on the source IP/Domain

Avatar

Level 2

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?

0 Replies

Avatar

Employee Advisor

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