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?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online