By daggett on
Sorry, if this does not seem to be a core drupal concern, but ...
I don't know where to look to find out how, with DNS and Apache, I can omit the leading 'www' in the host name so that my web sites can be reached with URLs like http://drupal.org, instead of http://www.drupal.org.
Can someone point me to the relevant DNS and/or Apache documentation?
Thanks
Comments
DNS
Make sure that the DNS entries (for example) yourdomain.com and www.yourdomain.com point to the same IP address (that of your webserver of course).
in your Apache config, if you use a vhost, you can do something like this
and also
look at the mod_rewrite example in the bottom part of the .htaccess file for additional ideas.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Thanks
Thank you for all the responses.
I just want the shortest possible URL. so that it is more likely to be remembered.
I think my best approach would be:
1. have DNS entries for both www.mydomain.com and mydomain.com (but I am not quite sure how to do the latter, see below), and
2. Use the Apache mod_rewrite as suggested by sepeck (but within an Apache <VirtualHost>...</VirtualHost> directive rather than with a .htaccess file). (However I am not absoltuley convinced that is preferable to the alternatives - see below.)
3. Always refer to resources on the site whethr in links or in text using the shorter URL.
mod_rewrite, ServerAlias or Redirect?
I would be interested to know thoughts as to why mod_rewrite is preferable to the ServerAlias directive. Also is there a reason why the Redirect (or RedirectPermanent variant of Redirect) cannot or should not be used?
DNS record for mydomain.org?
Here are some records from my nsd (light DNS implematiation) configuration files:
Logically, one would assume that the DNS record for saveinskip.org would be:
... that is no 'subdomain' name. Am I right? If not, how else is this done?
Abuse of cookies?
nancyw: I don't understand the 'abuse of cookies' issue mentioned by you. I just let anyone set cookies all the time. Makes life easier, I guess. Are there any documents out there that might convince me to be less complacent about this? (BTW, I use a Linux system rather than Micro$oft. Does that make a difference?)
James Sinnamon
To answer my own question ...
The correct DNS entry for saveinskip.org appears to be:
... as I wrote above.
Thanks to everyone again.
James Sinnamon
To answer another of my own questions ...
It seems that the ServerName alias mentioned by FvanT is necessary in addition to the DNS record and the Rewrite (mod_rewrite) directives.
It seems to now works as I require. http://www.saveinskip.org is now automatically redirected to http://saveinskip.org. (For now it s a a static placeholder site, until I can get drupal going.)
James Sinnamon
Not to worry
"Abuse of cookies" refers to others, not most Drupal sites. For example, the widespread use of tracking cookies to gather information on where I go on the web. All of those intrusive uses give the legitimate use of cookies a bad name.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
First
Ask yourself the more basic question: do I want to force them to not use "www?"
You do not *need* to use "www" unless the site's htaccess has set it to be required. You can probably refer to your site with "www" without doing anything.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
cookies, logins? umm SEO!?
except for the odd cookie and login issues, and SEO. SEO with multiple sites is absolutely an issue, and a potential problem for some sites... Best to choose either www or no www and forward all traffic to one or the other.
Visit no-www.org for one perspective on the issue.
True
From a search engine perspective you definitely want all your traffic going to one or the other - they will create two separate entries for myexample.com and www.myexample.com. And they will not add together the links. However, changing .htaccess to require one or the other is after the fact. You should work to ensure that all incoming links from everywhere you've submitted your link are all the same. I tell everyone I know to leave the "www" off all sites.
As far as the cookie goes, I'm not sure I see that as that much of an issue considering how many people I know who delete all their cookies frequently. Frankly, I use FF2 as my primary browser when I might want to keep a cookie and IE6 when I don't. I clear all my IE6 cookies several times a day. I clear my FF2 cookies manually several times a week. Largely, IMHO, the widespread abuse of cookies has rendered them nearly obsolete.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru