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

SOLVED

AEM Dispatcher MOD Rewrite Not Working

Avatar

Level 5

Hello Team,

 

We just setup dispatcher in local Window 10 Machine.

 

Apache Version:

arvind_0-1665348346529.png

Dispatcher Module downloaded from Adobe download console.

 

Dispatcher setup is done successfully. Pages are getting cached/invalidate after replication.

 

1)Filter rules work fine as well.

2)This is Virtual Host:

arvind_1-1665348585656.png

 

When we try to hit http://vm.local/content/weretail/us/en.html. It works fine

3) Entry in host file:

127.0.0.1 localhost
127.0.0.1 vm.local
127.0.0.1 vm.locall

 

Only Problem is :

 

Below is the link for Apache file along with All Configured Dispatcher files.

https://github.com/digi108/aem-disp-window/blob/main/Apache2.2.zip

 

We are not able to make rewrite working. When we try to hit http://vm.local, It does not redirect at all and gives us 404.

Below is our rewrite rules:

arvind_2-1665348785582.png

 

 

 

 

Regards,

KTNR

 

 

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hello All,

 

Thanks a lot for your support, Found root cause.

 

Under enabled_hosts, there were 2 different vhost taking priority before our real vhost. Now it is properly adjusted and fixed. Thanks.

View solution in original post

9 Replies

Avatar

Community Advisor

Hi @arvind 

 

In the above rules, i see the rewrite Rule is commented. did you try by uncommenting the rewrite rule?

RewriteEngine on
RewriteRule   "^/$"  "/content/we-retail.html"  [R]

Also you can check more rules here:  https://httpd.apache.org/docs/2.4/rewrite/remapping.html

Avatar

Level 5

Hi Siva,

 

Thank you for kind reply. Other rules are not commented.

 

BTW, It seems flow does not come till this rewrite rules file somehow.

Avatar

Community Advisor

Can you post your httpd conf which includes vhost file and vhost file where you included your rewrite file?

Avatar

Community Advisor

I saw your files, I think it is not even going to enabled vhost files and from there rewrite files..

 

It is picking up vhost conf from dispatchervhost itself, with 80 port

 

Try adding rewrite under it.

Avatar

Correct answer by
Level 5

Hello All,

 

Thanks a lot for your support, Found root cause.

 

Under enabled_hosts, there were 2 different vhost taking priority before our real vhost. Now it is properly adjusted and fixed. Thanks.