Custom configuration for website in httpd.conf
Hi,
I have some custom redirection rules for my website. These redirection rules are not working via .htaccess as expected as some of my files are loading from outside public_html. I have tried the same redirection rules directly in httpd.conf vhost section of the particular website. Then all the rules are found working fine as expected.
Meanwhile these custom redirection rules are found getting vanished after every apache rebuild and server restart. Is it possible to make my custom redirection rules permanent in httpd.conf ?
Let me know how can I do that ?
-
Copy and paste the entire vhost entry in the following file: /usr/local/apache/conf/includes/pre_virtualhost_global.conf or here in WHM: WHM>>Apache Configuration>>Include editor>>Pre Virtualhost Include>>All versions Restart apache if you add it directly to /usr/local/apache/conf/includes/pre_virtualhost_global.conf from CLI. A customized virtual host entry specified here is not overwritten. Any direct modifications to the httpd.conf file on cPanel servers is not recommended. It clearly states this on top of the httpd.conf file. 0 -
Hello :) Could you let us know the specific steps you are taking to add these entries to your Apache configuration file? It's important you follow the steps documented at: Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation Thank you. 0
Please sign in to leave a comment.
Comments
2 comments