403 Forbidden Response for Images using Dispatcher

403 Forbidden Response is seen for Images when using Dispatcher, a / is also appended to the end of the filename in the URL.

Environment

  • AEM 
  • Apache
  • Dispatcher 

Cause

The extra slash is due to Apache's mod_dir module which appends / to a request URL that maps to a directory.

Resolution

Set DirectorySlash directive to off in Apache's mod_dir module:
      <Directory />
          <IfModule disp_apache2.c>
             # enable dispatcher for ALL request if this is too restrictive,
             # move it to another location
             # RequestHeader add uid "admin"
           DirectorySlash Off
           SetHandler dispatcher-handler
         </IfModule>
         Options FollowSymLinks
         AllowOverride None
      </Directory>

Additional information

DirectorySlash Directive http://httpd.apache.org/docs/current/mod/mod_dir.html#directoryslash Interference with Mod_Dir (Apache) https://docs.adobe.com/docs/en/dispatcher/disp-tshoot.html#Interference with mod_dir (Apache)

 Adobe

Get help faster and easier

New user?