Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

AEM Dispatcher MOD Rewrite Not Working

Avatar

Level 6

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 6

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

@arvind have you enabled Mod_rewrite module in httpd.conf?

https://ubiq.co/tech-blog/how-to-enable-mod_rewrite-in-xampp-wamp/ 

Avatar

Level 6

Hi @Shashi_Mulugu ,

 

It is one of the first thing, I did during setup. Mod:rewrite is enabled already.

 

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

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 6

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

Level 6

@kautuk_sahni , Any help/suggestion pls

Avatar

Community Advisor

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

Avatar

Level 6

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 6

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.