Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd March 2011, 20:59
jopa123 jopa123 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 140
Thanks: 10
Thanked 1 Time in 1 Post
Default www versus non www

Can someone tell me how to make my websites display (in a browser) WITH the www rather than without?

For instance

http://www.example.com

instead of

http://example.com
Reply With Quote
Sponsored Links
  #2  
Old 23rd March 2011, 05:29
astinsan astinsan is offline
Junior Member
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Are you asking how to setup an alias in your apache server (if that is your httpd) or are you asking howto setup a cname?
Reply With Quote
  #3  
Old 23rd March 2011, 05:37
jopa123 jopa123 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 140
Thanks: 10
Thanked 1 Time in 1 Post
Default

I really don't know. I guess that's what I'm asking, what is the proper way to make the site resolve to the www address when it is clicked on from some outside link. Do I do this via cname or via an alias?

Apache is my server.

Thanks
Reply With Quote
  #4  
Old 23rd March 2011, 08:16
astinsan astinsan is offline
Junior Member
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You can use rewrite Here is an example that I found at http://www.thesitewizard.com/apache/...ubdomain.shtml
Code:
How to Automatically Add the "www" Prefix to Your Domain Names in URLs

To redirect (say) example.com to www.example.com, add the following code to your .htaccess file.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

The above code causes the server to check that the domain name portion of the URL is example.com. If it is, the visitor will be sent to www.example.com instead.
Hope this helps...
Reply With Quote
  #5  
Old 23rd March 2011, 15:17
jopa123 jopa123 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 140
Thanks: 10
Thanked 1 Time in 1 Post
Default

Thanks, Astinsan.

Do I need to add this code for each and every domain? I was hoping that there was a setting in ISPConfig that could handle this for me but if not this will work.

Thanks again
Reply With Quote
  #6  
Old 23rd March 2011, 15:54
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Quote:
Originally Posted by jopa123 View Post
Do I need to add this code for each and every domain?
Yes, you must do this for every domain.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
jopa123 (23rd March 2011)
  #7  
Old 23rd March 2011, 16:36
astinsan astinsan is offline
Junior Member
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Yes but there should be a way to set default options for new accounts. Most scripts do this. I am not familiar with ispconfig but I am sure there has to be a way.
Reply With Quote
The Following User Says Thank You to astinsan For This Useful Post:
jopa123 (23rd March 2011)
  #8  
Old 23rd March 2011, 21:04
jopa123 jopa123 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 140
Thanks: 10
Thanked 1 Time in 1 Post
Default

I thought the "auto subdomain" field in ISPConfig might would be the way, but I have set each of my sites to the "www" option in the auto subdomain field and it does not accomplish what I am trying to do.

Thanks for the help, tho, guys.
Reply With Quote
  #9  
Old 24th March 2011, 02:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

From the ISPConfig 3 Manual:

Quote:
Auto-Subdomain: Here you can define whether you want no automatic subdomain for the web site (in this case you can access the site only by using the domain, e.g. http://example.com), an automatic www subdomain (you can then access the site using http://example.com and http://www.example.com), or a wildcard subdomain (*.) which means you can access the site with any subdomain that does not point to another web site.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 6th December 2011, 19:53
xciso xciso is offline
Member
 
Join Date: Feb 2008
Posts: 52
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

I have checked the box but my site dont show the www before my domain.
Do i have to make a subdomain or a cname for www?

I thought the checkbox is for this thing.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
squirrelmail and postfix witoszek General 12 1st December 2009 18:07
Security problem 2 ???? the revenge :) albertux Installation/Configuration 2 22nd September 2009 18:44
Mail Log Question - Is This Normal gwiz Installation/Configuration 7 12th September 2009 03:09
550 Sender verify failed Allen15 Installation/Configuration 11 13th February 2009 14:02
Problem recieving mail webstergd Installation/Configuration 19 16th December 2005 12:08


All times are GMT +2. The time now is 11:07.


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