Posted by hbhb, 07-12-2007, 05:33 AM | I created a new cpanel account subdomain.domain.com
Sometimes i goto http://subdomain.domain.com on my browser, it changes to www.subdomain.domain.com
I want to disable 'www' for some 'xml' script reason.
How do I do that?
|
Posted by Jakiao, 07-12-2007, 07:12 AM | It's changing you like that due to "UseCanonicalName on" in httpd.conf.
If you change "UseCanonicalName on" to "UseCanonicalName off" it won't redirect you like it is now. Try it, then restart Apache.
|
Posted by tracphil, 07-12-2007, 08:01 AM | cpanel sets up a ServerAlias for www.subdomain by default and sets up DNS records accordingly.
UseCanonicalName is on for me and my subdomain's do not redirect.
Strange that yours do.
Do you have access to your servers httpd.conf?
|
Posted by hbhb, 07-12-2007, 08:58 PM | Yes I have access, here's how the subdomain setting looks like:
ServerAlias subdomain.domain.com
ServerAdmin webmaster@subdomain.domain.com
DocumentRoot /home/username/public_html
BytesLog domlogs/subdomain.domain.com-bytes_log
php_admin_value open_basedir "/home/support/:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value open_basedir "/home/support/:/usr/lib/php:/usr/local/lib/php:/tmp"
ServerName www.subdomain.domain.com
User username
Group username
ErrorLog /usr/local/apache/domlogs/subdomain.domain.com-error_log
CustomLog /usr/local/apache/domlogs/subdomain.domain.com combined
ScriptAlias /cgi-bin/ /home/support/public_html/cgi-bin/
Should i change the ServerName www.subdomain.domain.com to subdomain.domain.com?
or add a line under it?
UseCanonicalName off
|
Posted by Patrick, 07-12-2007, 09:02 PM | Remove the following line and restart Apache:
ServerName www.subdomain.domain.com
|
Posted by choon, 07-12-2007, 09:07 PM | Change the following:
ServerAlias subdomain.domain.com
ServerName www.subdomain.domain.com
to
ServerName subdomain.domain.com
ServerAlias www.subdomain.domain.com subdomain.domain.com
Then restart your apache.
|
Posted by tracphil, 07-12-2007, 09:08 PM | I would do what Pat H said, but I would change ServerAlias to ServerName.
|
Posted by tracphil, 07-12-2007, 09:12 PM | Grrrrrr. I wasn't quick enough on the draw
|
Posted by choon, 07-12-2007, 09:12 PM | My previous reply won't disable www but to make both of them work and stay as it is like if you visit without www, it will stay as it is and likewise for with www.
|
Posted by hbhb, 07-13-2007, 01:58 AM | Thanks, I changed it this way. I hope it's correct. I restarted Apache and it seems working! (I hope it's not cache!)
ServerName subdomain.domain.com www.subdomain.com
ServerAdmin webmaster@subdomain.domain.com
DocumentRoot /home/username/public_html
BytesLog domlogs/subdomain.domain.com-bytes_log
php_admin_value open_basedir "/home/support/:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value open_basedir "/home/support/:/usr/lib/php:/usr/local/lib/php:/tmp"
ServerAlias www.subdomain.domain.com
User username
Group username
ErrorLog /usr/local/apache/domlogs/subdomain.domain.com-error_log
CustomLog /usr/local/apache/domlogs/subdomain.domain.com combined
ScriptAlias /cgi-bin/ /home/support/public_html/cgi-bin/
|
Posted by SparkSupport, 07-13-2007, 05:01 AM | Change the 2nd line of this block as given below and restart Apache
ServerName subdomain.domain.com
|
Posted by hbhb, 07-13-2007, 05:08 AM | Fixed as follows. Correct?
ServerAlias www.subdomain.domain.com subdomain.domain.com
ServerAdmin webmaster@subdomain.domain.com
DocumentRoot /home/username/public_html
BytesLog domlogs/subdomain.domain.com-bytes_log
php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/local/lib/php:/tmp"
ServerName subdomain.domain.com
|
Posted by tracphil, 07-13-2007, 07:42 AM | This is what you need:
|
|
Add to Favourites
Print this Article |