Expand my Community achievements bar.

SOLVED

Issue in Dispatcher Rewrite rule

Avatar

Level 2

Hi Guys

when I request the URL it should go to the requested path but it redirected to below URL and it comes with '/' in the end instead of

'.html'

Requested path : https://<DOMAIN-URL>/en/ENV/products/television.just_parsys.html (301)

Redirected to: https://<DOMAIN-URL>/en/ENV/products/television.just_parsys/
(trailing slash appended) (404)


Please give me some solution.

1 Accepted Solution

Avatar

Correct answer by
Level 10

check if DirectorySlash is turned off or not  -- this would take care of the trailing slash in webserver assuming apache in this context.

mod_dir - Apache HTTP Server Version 2.4

Does this redirect happen from apache-redirect rules or AEM-sling mappings? Could you share appropriate logs?

Could you share the httpd.conf/rewrite rules/dispatcher.any as applicable in this use case?

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

check if DirectorySlash is turned off or not  -- this would take care of the trailing slash in webserver assuming apache in this context.

mod_dir - Apache HTTP Server Version 2.4

Does this redirect happen from apache-redirect rules or AEM-sling mappings? Could you share appropriate logs?

Could you share the httpd.conf/rewrite rules/dispatcher.any as applicable in this use case?

Avatar

Level 2

Thanks Gaurav for the reply.

Directory Slash we are not using,  But we found  like some other rules is blocking and corrected.  Thanks

Avatar

Level 3

It would be helpful if you can post what solved your problem with some details.

Note: on turning off DirectorySlash -

# see security warning below! <Location "/some/path"> DirectorySlash Off SetHandler some-handler </Location>

Security Warning

Turning off the trailing slash redirect may result in an information disclosure. Consider a situation where mod_autoindex is active (Options +Indexes) and DirectoryIndex is set to a valid resource (say, index.html) and there's no other special handler defined for that URL. In this case a request with a trailing slash would show the index.html file. But a request without trailing slash would list the directory contents.