cPanel Community,
I want to have http://www.domain-name.tld/mailman/listinfo redirected to http://domain-name.tld/mailman/listinfo (without the www.)
I added some Rewrite Rules to the Post VirtualHost Include (/usr/local/apache/conf/includes/post_virtualhost_global.conf) using the cPanel Include Editor for all Apache version.
The Rewrite Rules did not work, so I tried a simple Rewrite Rule that works in /home/domain-username/public_html/.htaccess:
RewriteEngine On
RewriteLog "/var/log/rewrite.log"
RewriteLogLevel 2
RewriteCond %{HTTP_HOST} ^www\.domain-name\.tld$ [NC]
RewriteRule ^(.*)$ http://domain-name.tld/$1 [R,L]
The RewriteLog and RewriteLogLevel commands are effective, so I know that Apache is reading the file.
However, the RewriteRule is not effective.
What am I doing wrong? Is the HTTP_HOST not available at this point?
The Rewrite Logs do not show that Apache evaluated the Rewrite Rule for domain-name.tld
I tried putting the same commands in /usr/local/apache/conf/userdata/mailman.conf and got the same results.
# /scripts/verify_vhost_includes
Testing /usr/local/apache/conf/userdata/mailman.conf...ok
Jim
I want to have http://www.domain-name.tld/mailman/listinfo redirected to http://domain-name.tld/mailman/listinfo (without the www.)
I added some Rewrite Rules to the Post VirtualHost Include (/usr/local/apache/conf/includes/post_virtualhost_global.conf) using the cPanel Include Editor for all Apache version.
The Rewrite Rules did not work, so I tried a simple Rewrite Rule that works in /home/domain-username/public_html/.htaccess:
RewriteEngine On
RewriteLog "/var/log/rewrite.log"
RewriteLogLevel 2
RewriteCond %{HTTP_HOST} ^www\.domain-name\.tld$ [NC]
RewriteRule ^(.*)$ http://domain-name.tld/$1 [R,L]
The RewriteLog and RewriteLogLevel commands are effective, so I know that Apache is reading the file.
However, the RewriteRule is not effective.
What am I doing wrong? Is the HTTP_HOST not available at this point?
The Rewrite Logs do not show that Apache evaluated the Rewrite Rule for domain-name.tld
I tried putting the same commands in /usr/local/apache/conf/userdata/mailman.conf and got the same results.
# /scripts/verify_vhost_includes
Testing /usr/local/apache/conf/userdata/mailman.conf...ok
Jim