where to write .htaccess related changes in AEM projects | Community
Skip to main content
RitendraS11
Level 4
December 9, 2021
Solved

where to write .htaccess related changes in AEM projects

  • December 9, 2021
  • 1 reply
  • 2459 views

I have an AEM project, which is running on Apache web server. I got an requirement to add .htaccess file at some directory location (page path). Need to know as if where this .htaccess file should be written. 

I had gone through the documentations on Adobe and also followed sample WKND project.As per my assumptions, .htaccess files are not present in AEM dispatcher setup and we need to add those lines of code inside vhost file for the specific website. I know, it could be a general and silly question - but, need to know and any guidance will be appreciated.

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 Raja-Karuppsamy

@ritendras11 

1. We can create the .htaccess file under /etc/httpd/conf.d directory as a file
(by using this command -> htpasswd -c /etc/httpd/conf.d/dispatcher.htaccess user) or
2. Create a directory called htaccess under /etc/httpd/conf.d and keep all the .htaccess files under htaccess directory.
(by using this command -> htpasswd -c /etc/httpd/conf.d/htaccess/dispatcher.htaccess user)

Make sure to add the .htaccess file path in the virtual-host section.

 

please refer these articles:

https://www.albinsblog.com/2021/09/how-to-enable-basic-authentication-for-aem-and-cloudmanager.html

https://www.albinsblog.com/2015/06/enabling-basic-authentication-for-adobecq5-adobeaem.html

 

1 reply

Raja-Karuppsamy
Community Advisor
Raja-KaruppsamyCommunity AdvisorAccepted solution
Community Advisor
December 9, 2021

@ritendras11 

1. We can create the .htaccess file under /etc/httpd/conf.d directory as a file
(by using this command -> htpasswd -c /etc/httpd/conf.d/dispatcher.htaccess user) or
2. Create a directory called htaccess under /etc/httpd/conf.d and keep all the .htaccess files under htaccess directory.
(by using this command -> htpasswd -c /etc/httpd/conf.d/htaccess/dispatcher.htaccess user)

Make sure to add the .htaccess file path in the virtual-host section.

 

please refer these articles:

https://www.albinsblog.com/2021/09/how-to-enable-basic-authentication-for-aem-and-cloudmanager.html

https://www.albinsblog.com/2015/06/enabling-basic-authentication-for-adobecq5-adobeaem.html