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?
Answer
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
- From the main dashboard, go to Administration -> Settings -> General.
- Next, look for the WordPress address (URI): and change it from (example.com/wordpress to example.com)
- Lastly, look for the Site Address address (URL): and change it from (example.com/wordpress to example.com)
No comments:
Post a Comment