Dispatcher caching extra / in html page | Community
Skip to main content
sunily21159739
New Participant
August 17, 2023
Solved

Dispatcher caching extra / in html page

  • August 17, 2023
  • 3 replies
  • 954 views

Hi All,

 

Extra "/" is adding in the end of the page like : https://domainname/content/abc/dashboard.html/ and this is cached on dispatcher level because dispatcher is treating dashboard.html page as a directory.

 

On dispatcher side we can see this url used by some user "dashboard.html/content/dam/abc/us/project-folder/image/common/icon/favicon"

How can we restrict it, so that dispatcher will not treat this page as directory and "/" will not append in the url. Please suggest.

We are using AEM6.4 right now.

 

 

 

Thanks

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 Mahedi_Sabuj

Hi @sunily21159739

 

<IfModule disp_apache2.c> DirectorySlash Off SetHandler dispatcher-handler </IfModule>

 

3 replies

Harwinder-singh
New Participant
August 17, 2023

@sunily21159739 , you need to Set DirectorySlash directive to off in Apache's mod_dir module.

 

Refer to the below link :

 

https://helpx.adobe.com/id_id/experience-manager/kb/403-forbidden-response-images-using-Dispatcher.html

 

Mahedi_Sabuj
Mahedi_SabujAccepted solution
New Participant
August 17, 2023

Hi @sunily21159739

 

<IfModule disp_apache2.c> DirectorySlash Off SetHandler dispatcher-handler </IfModule>

 

Mahedi Sabuj
sherinregi-1
New Participant
August 17, 2023

Hi @sunily21159739 

One way i can think of is to add a rewrite that will remove the trailing slash from your URL's . You can use the below snippet and add the same in the apache rewrites.

 

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_URI} (.*)/$

RewriteRule ^(.*)/$ $1 [L,R=301]

 

Remove R=301 if you don't want to show the redirect 

 

You can also test the same in the below url

https://technicalseo.com/tools/htaccess/

 

Hope it helps!