Apache mod rewrite before the page hits dispatcher | Community
Skip to main content
Peter_Puzanovs
Community Advisor
Community Advisor
October 16, 2015
Solved

Apache mod rewrite before the page hits dispatcher

  • October 16, 2015
  • 4 replies
  • 2359 views

Hi,

 

Is it possible to ask Apache mod_rewrite to rewrite the page url before it hits the dispatcher ?

 

E.g. make "?" a ".".

E.g some/url/that/is/not/caches?becouseof=this would become some/url/that/is//cached.becouseof.this

http://helpx.adobe.com/experience-manager/kb/DispatcherModReWrite.html did not seem to work is there a better documentation ?

Thanks,

Peter

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by PaulMcMahon

There are lots of reasons a rewrite rule might fail to be applied to an incoming request. The article you referenced has all the AEM/Dispatcher specific reasons why a rewrite rule might fail to be applied. Have you turned up the debug level for mod_rewrite to see what it thinks is happening. It's possible that you have applied your rewrite rule in wrong element in httpd.conf for example or that there is some error in your regular expression and looking at the debug output from mod_rewrite will help identify these issues. 

4 replies

Adobe Employee
October 16, 2015

Don't forget to set the dispatcherUseProcessedURL flag in your httpd.conf file. 

PaulMcMahonAccepted solution
Level 8
October 16, 2015

There are lots of reasons a rewrite rule might fail to be applied to an incoming request. The article you referenced has all the AEM/Dispatcher specific reasons why a rewrite rule might fail to be applied. Have you turned up the debug level for mod_rewrite to see what it thinks is happening. It's possible that you have applied your rewrite rule in wrong element in httpd.conf for example or that there is some error in your regular expression and looking at the debug output from mod_rewrite will help identify these issues. 

Level 5
October 16, 2015

PuzanovsP wrote...

Hi,

 

Is it possible to ask Apache mod_rewrite to rewrite the page url before it hits the dispatcher ?

 

E.g. make "?" a ".".

E.g some/url/that/is/not/caches?becouseof=this would become some/url/that/is//cached.becouseof.this

http://helpx.adobe.com/experience-manager/kb/DispatcherModReWrite.html did not seem to work is there a better documentation ?

Thanks,

Peter

 

Hi,

In case you want to make your page cachable with query parameters, You can configure you dispatcher.any file with ignoreurlsparams section. You can refer this https://forums.adobe.com/message/4930557#493055 .

Thanks