Expand my Community achievements bar.

SOLVED

where to write .htaccess related changes in AEM projects

Avatar

Level 5

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@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