Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Feb 03, 2012 11:40 pm 
Offline
Newbie

Joined: Thu Feb 02, 2012 2:07 am
Posts: 3
I try to domain my name url register without typing www. in front.
But If I delete one conf files , the DNS were not works.
.......................................conf one.........

server
{
listen 80;
server_name www.xxx.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/lovelytruth;

include wordpress.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

access_log off;
}

........................two.............

server
{
listen 80;
server_name www.xxx.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/lovelytruth;

include wordpress.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

access_log off;
}


Top
   
 Post subject:
PostPosted: Sun Feb 05, 2012 12:51 am 
Offline
Senior Member

Joined: Sun Oct 30, 2005 7:52 pm
Posts: 97
I think what your looking for is a single configuration with:

Code:
server_name www.example.com example.com;

that will allow http requests for either the base domain or www (dot) base domain.

--
Travis


Top
   
 Post subject:
PostPosted: Sun Feb 05, 2012 7:45 am 
Offline
Newbie

Joined: Thu Feb 02, 2012 2:07 am
Posts: 3
Thanks !!1

Let me try again.


Top
   
 Post subject:
PostPosted: Sun Feb 05, 2012 3:30 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
That will make www.example.com and example.com load the same content, and some search engines might think that you've got two different sites with identical content. Not good for SEO, according to received wisdom.

The best solution is to have the www version be the "real" website, and if anyone doesn't type www, automatically redirect them to the www version. (Or you can do it the other way around if you don't like www.)

This would require one full configuration, followed by a small stub for the redirect.

Code:
server {
    listen 80;
    server_name www.example.com;
    ... lots of other stuff ...
}

server {
    server_name example.com;
    rewrite ^ http://www.example.com$request_uri? permanent;
}

Not that this may be unnecessary if your CMS automatically handles canonical URLs. WordPress does this.


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 9:11 pm 
Offline
Newbie

Joined: Thu Feb 02, 2012 2:07 am
Posts: 3
thanks for your help.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group