vhost include issues
Hi,
I've been having some trouble with a custom config I am including in the httpd.conf.
I was wanting to move a great deal of redirects from the websites .htaccess into the VirtualHost.
Previously in the past this has worked, but for some reason not this time. Am I missing something?
For example...
This is written to the file, then I run some checks before rebuilding the httpd.conf
This tells me it has found the new conf and has confirmed it is OK.
Restart Apache When I check to see if this works, it fails? If I include it back into the .htaccess it works successfully. Thanks in advance. Mart
$ vi /usr/local/apache/conf/userdata/std/2/xxx/xxxx.com/main.conFor example...
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.xxx\.com [NC]
RewriteRule ^(.*)$ http://www.xxx.com/$1 [L,R=301]
This is written to the file, then I run some checks before rebuilding the httpd.conf
$ /scripts/verify_vhost_includesThis tells me it has found the new conf and has confirmed it is OK.
$ /usr/local/cpanel/bin/apache_conf_distiller --update --main$ /usr/local/cpanel/bin/build_apache_confRestart Apache When I check to see if this works, it fails? If I include it back into the .htaccess it works successfully. Thanks in advance. Mart
-
Hello :) Try using the specific version of Apache (e.g. 2.2, 2.4) to see if that makes a difference. EX: /usr/local/apache/conf/userdata/std/2_2/$user/$domain/$includename.conf
The full documentation is available here: Changes Contained Within a VirtualHost Directive Note it's not necessary to run the Apache distiller after editing VirtualHost include files. Thank you.0
Please sign in to leave a comment.
Comments
1 comment