I am in desperate need of assistance!
I need my website, let's call it www.example.com, to use both www.example.com and example.com (pretty common need I'm sure). However, when I installed Drupal and setup Apache to point to the root of my installation directory it didn't work correctly.
The virtual host is setup for my domain example.com and to accept www.example.com as an alternative. The URL example.com works fine, however, when I go to www.example.com, it lists the folders under the www/ directory! NOT COOL! I switched the two around and set www.example.com as the main and example.com as the alternative and the opposite happened (www.example.com worked and the other showed my folders).
I tried to use the URL redirect in htaccess, so I could at least just redirect traffic, but it didn't do anything. It still shows my files.
Any advice would be GREATLY appreciated.
Thank you in advance!

Comments

DoctorDru’s picture

Add this in your DNS records file for your domain:

www IN CNAME example.com.

(do not forget the period after domain name extension)

OR

edit your apache httpd.conf and under the virtual host settings for your domain, add this:

ServerAlias *.example.com.

------------
DoctorDru

tonyp001’s picture

I tried those apache settings with no luck.
Unfortunately, I have a third party in control of DNS. I requested the change that you suggested and they said they made it; however, I'm still have the same problem.
I'm not sure what's going wrong here.

tonyp001’s picture

It's possible that I've configured something incorrectly. Besides the suggestions above, is there anything else I should be doing?