Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th June 2010, 19:36
wxman wxman is offline
Senior Member
 
Join Date: May 2007
Posts: 189
Thanks: 11
Thanked 2 Times in 2 Posts
Default Looking for setting that prevents www and non www

I was just fighting with trying to get my sites to work with both www and non www. I edited the htaccess files, made sure I have both A records, and ISPConfig "Auto-Subdomain" was set to '*'. I even added:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
to the Apache directives options box. It still wouldn't work.

I went into my apache files and looked up one of the domain
'etc/apache/sites-available/www.domain.com.vhost' files and found it like this:

Code:
<Directory /var/www/www.domain.com>
    AllowOverride None
    Order Deny,Allow
    Deny from all
</Directory>
<VirtualHost *:80>
      DocumentRoot /var/www/www.domain.com/web
  
    ServerName www.domain.com
    ServerAlias *.www.domain.com
    ServerAdmin webmaster@domain.com

....
Once I edited "ServerAlias *.www.domain.com" so it reads "ServerAlias *.domain.com domain.com" then it works.
My question is, what setting in ISPConfig is automatically making it look like "ServerAlias *.www.domain.com" when you select "Auto-Subdomain" set to '*'?
Reply With Quote
Sponsored Links
  #2  
Old 28th June 2010, 19:53
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,769
Thanks: 821
Thanked 5,331 Times in 4,183 Posts
Default

You have setup the website in the wrong way. In the domain field, you have to enter domain.com and not www.domain.com and then select auto subdomain www and not auto subdomain *.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 28th June 2010, 21:01
wxman wxman is offline
Senior Member
 
Join Date: May 2007
Posts: 189
Thanks: 11
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by till View Post
You have setup the website in the wrong way. In the domain field, you have to enter domain.com and not www.domain.com and then select auto subdomain www and not auto subdomain *.
Ok that looks better when I tried that. What happens if I ever want to add another sub domain? Do I have to set the subdomain back to '*'?
Reply With Quote
  #4  
Old 28th June 2010, 21:16
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,769
Thanks: 821
Thanked 5,331 Times in 4,183 Posts
Default

No. Then you add a subdomain. The setting * is only used for cms systems that require wildcard setting like the multiuser version of wordpress (wordpress MU)
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 29th June 2010, 00:30
wxman wxman is offline
Senior Member
 
Join Date: May 2007
Posts: 189
Thanks: 11
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by till View Post
No. Then you add a subdomain. The setting * is only used for cms systems that require wildcard setting like the multiuser version of wordpress (wordpress MU)
A lot of my sites are Drupal installs. If I decide to go multi site install, then I'd use that?
Reply With Quote
  #6  
Old 29th June 2010, 08:43
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,769
Thanks: 821
Thanked 5,331 Times in 4,183 Posts
 
Default

Quote:
A lot of my sites are Drupal installs. If I decide to go multi site install, then I'd use that?
Yes. If these sites are all subdomains of the same domain. If not, you add aliasdomains and dont use the wildcard. The problem with wildcards is that if you have a website with wildcard enabled and then you decide to add another website with a subdomain of the same domain, then this econd website will not work as all traffic is routed to the first website. Additionally, wildcards are bad for your google rank as you get a lot of duplicate content from googles point of view, as countless subdomains point to the same vhost.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.