0

I am in the process of migrating my wordpress, website www.programminginc.net, which is presently running on a shared hosting site, to a VPS Server with nginx Server. I have selected an Ubuntu 12.04.3 LTS server for my VPS hosting. I could complete almost all jobs with the help of EasyEngine script and was successful in installing my website. After installation, my wordpress site URL was missing the www prefix. It was installed with the url [http://programminginc.net] not with [http://www.programminginc.net].

So, I changed the wordpress in dashboard general setting the WordPress Address (URL) and Site Address (URL) [http://programminginc.net] to [http://www.programminginc.net]. After this change my website stopped working.

Can you help me figure out where the error is and how can I correct it? Is it the problem with wordpress or nginx itself? Thanks in advance.

Nathan S.
  • 5,244
  • 3
  • 45
  • 55

2 Answers2

0

Could be the configuration for nginx, make sure it is handling the request for www.example.com and make sure that there is an A record present for www

Mario Segura
  • 325
  • 1
  • 8
0

EasyEngine bydefault removed http:// https:// and www from the url and make website accessible via example.com and www.example.com

To make non-www to www you need to change the following file:

vim /etc/nginx/sites-available/example.com

# WPSINGLE BASIC NGINX CONFIGURATION
server {

        server_name example.com www.example.com;

Replace above code with following lines

# WPSINGLE BASIC NGINX CONFIGURATION
server {
        server_name example.com;
        return 301 $scheme://www.example.com$request_uri;
}
server {

        server_name www.example.com;

Track this issue on github easyengine page: https://github.com/rtCamp/easyengine/issues/71

Mitesh Shah
  • 121
  • 9