Redirecting /libs/granite/core/content/login to Error page in AEM 6.5



Hi all,

When we hit our marketing site domain https://domain//libs/granite/core/content/login.html we are getting OOTB AEM login page. 

As per our security audit, we are not suppose to show login page and display a error page.


In dispatcher we already have DENY rule on this path. But still when we hit our marketing sites domain with above path, it's redirecting to login page.


Could you please provide any tips on how to block this login page and redirect to "Pagenotfound" error page.




AEM 6.5 Dispather

Accepted Solutions (1)

Accepted Solutions (1)



At apache, you can write a rewrite rule, which redirects to your custom 404 error page.


<VirtualHost *:80>
   ErrorDocument 404 /custom_404.html
// rewirte rule </VirtualHost>


Answers (2)

Answers (2)




Hi @Antony6790 


Would you check if this page is cached on diaptcher or not? Because if the page is cached, even though you deny that page in dispatcher filter, that does not work.


When request comes, dispatcher first find page in docroot directory for cache files, if it finds the requested resource, it checks if page is not stale and if not, it returns from cache. But if the page is not present, only then it goes to dipatcher any file to match the request with filters.


Let me know if it works for you.





We do have different vhost for our webssites and rewrite rules.


Our requirement is redirect to error page only if the path is "/libs/granite/core/content/login.html"


I have added a redirect condition that if the URI matches to this path then redirect to error page but it's not working.