I have a set of canonical 301 redirects in place in htaccess... i.e. example.com redirects to www.example.com.
However, it's causing problems with subdomains and beta.example.com becomes example.com/beta/
The general consensus with Apache experts is that the htaccess code is not the problem, rather there is something within cPanel clashing with the htaccess code. Are there any cPanel engineers or gurus here that can suggest what might be causing this issue? The code from htaccess is below...
However, it's causing problems with subdomains and beta.example.com becomes example.com/beta/
The general consensus with Apache experts is that the htaccess code is not the problem, rather there is something within cPanel clashing with the htaccess code. Are there any cPanel engineers or gurus here that can suggest what might be causing this issue? The code from htaccess is below...
Code:
# Externally redirect requests for non-blank, non-canonical hostnames to canonical hostnames
#
# Canonicalize "newservice"
RewriteCond %{HTTP_HOST} newservice\.example\.com
RewriteCond %{HTTP_HOST} !^newservice\.example\.com$
RewriteRule ^(.*)$ http://newservice.example.com/$1 [R=301,L]
#
# Canonicalize "beta"
RewriteCond %{HTTP_HOST} beta\.example\.com
RewriteCond %{HTTP_HOST} !^beta\.example\.com$
RewriteRule ^(.*)$ http://beta.example.com/$1 [R=301,L]
#
# Canonicalize all others
RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteCond %{HTTP_HOST} !^(www|newservice|beta)\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Last edited: