I've been searching for an answer to this problem for 5 days, and hopefully someone here knows the solution.
Firstly, I'd like to provide the information that I too am a programmer, experienced in Perl, PHP, JS, Java, VRML, and a little C++, Python, and Delphi.
I have a domain: example.com
that I've created a full independent subdomain for which does not live under the root folder path of example.com
This is a fully qualified subdomain with it's own dns and it's own file path from root that does not connect to the main domain example.com at all. I created the subdomain in WHM on my server backend.
The subdomain is for example:
subdomain.example.com
Then, under the subdomain.example.com folder path (in CPanel) I created the subs of:
sub1.subdomain.example.com
sub2.subdomain.example.com
Now, the root paths for subdomain.example.com
is: /home/user/subdom/public_html/
The root path for the subs of subdomain.example.com
is: /home/user/subdom/public_html/sub1/
is: /home/user/subdom/public_html/sub2/
These are browser reachable by both www and non-www versions.
Google has issues with this big time.
I've tried redirecting subdomain.example.com
from www to non-www
via .htaccess file located at
/home/user/subdom/public_html/.htaccess
and it works fine and does the redirect from www to non-www
But, it forces the subs to their respective folders Vs being treated as sub.subdomain.example.com
In other words, the subs go to:
subdomain.example.com/sub1/
subdomain.example.com/sub2/
If I put 301 .htaccess redirects in for
subdomain.example.com AND
sub1.subdomain.example.com AND
sub2.subdomain.example.com
into the .htaccess file located at
/home/user/subdom/public_html/.htaccess
it creates an infinite loop
If I place .htaccess 301 redirect for JUST
subdomain.example.com
at: /home/user/subdom/public_html/.htaccess
it redirects www to non-www
then placing the same for the subs located in their respective folders:
/home/user/subdom/public_html/sub1/.htaccess
/home/user/subdom/public_html/sub2/.htaccess
it redirects the sub.subdomains from www to non-www
BUT breaks the www to non-www redirect for
subdomain.example.com
Does anyone have any idea how the heck this is supposed to be done? Quite honestly, I'm going out of my mind trying to find the answer.
At help would be very greatly appreciated!
Thanks!
Also, I like this forum and plan to stick around. I'm a good programmer and maybe I can help someone else when they need answers, too?

