0

I'm setting a wordpress up with nginx. Everything's seems ok :

  • server is up
  • phpinfo() test is ok
  • the worpress install routine is showing up

The only trouble is the root statement in the web server conf file. If I use :

[/etc/nginx/sites-available/wordpress]
server{
    root /var/www;
    index index.php
    server_name example.com
    ...
}

I can reach the service using http://example.com/wordpress, now I want wordpress to be designated as the root folder. Here's the change :

[/etc/nginx/sites-available/wordpress]
server{
    root /var/www/wordpress;
    index index.php
    server_name example.com    
   ...
} 

Broken! The web page http://example.com is only displaying basic html data, no pics, no css, ... ugly. No errors reported in /var/log/nginx/access.log

nginx version: nginx/1.2.1

What's wrong?

  • Where did you put the Wordpress install? Did you move the complete install to /var/www/wordpress after you changed the config? – Sven Dec 15 '14 at 13:35
4

You should also update the wordpress configuration. Without that, wordpress still links the static content to subdirectory. Step taken from Moving your Wordpress from a subfolder to the root directory

  1. From the main dashboard, go to Administration -> Settings -> General.
  2. Next, look for the WordPress address (URI): and change it from (example.com/wordpress to example.com)
  3. Lastly, look for the Site Address address (URL): and change it from (example.com/wordpress to example.com)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.