Dispatcher mod_rewrite not working? | Community
Skip to main content
daitienshi
Level 2
Aug 23, 2017 4:59 PM UTC
Solved

Dispatcher mod_rewrite not working?

Related to another post (AEM Dispatcher not resolving vanity urls),​ I've created some rewrite rules in my httpd.conf in my dispatcher so that when I hit my site's root (e.g. www.mysite.com/), it should rewrite/redirect to a page of my choosing (e.g. www.mysite.com/content/mysite/login.html).

However, when I hit the root, I'm getting a response with a redirect (302) to /index.html instead, even though I've created a rewrite rule for this.

In my httpd.conf, I have:

Ideally, what I'd like is a combination of vanity urls and rewrite so that anything that hits the root get redirected to the vanity url, which I had tried to set up by configuring the sling:redirect property of the /content node, but the dispatcher keeps returning index.html instead of the value of the sling:redirect.

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Employee
Aug 23, 2017 7:47 PM UTC

In the second case the dispatcher still forwards the request to AEM, although it should not. Have you restarted the httpd to make that change effective?

If yes, please provide all webserver configuration (including dispatcher config) for both cases and report an issue with AEM support.

Jörg

12 replies

daitienshi
Level 2
Aug 23, 2017 5:41 PM UTC

Hi,

I did set that value to 1 and the dispatcher.log still says it's returning a 302 to /index.html. 

Is this supposed to let the root request pass through to the publisher? This way the publisher can return the redirected page as configured in the sling:redirect in the /content node?

Thanks!

Translate
joerghoh
Employee
Aug 23, 2017 5:17 PM UTC

Have you set in the httpd.conf the statement "DispatcherDeclineRoot 1"?

See Installing Dispatcher - docs.adobe.com

regards,

Jörg

Translate