Under review

Setting up Wordpress in a subdirectory

Gergely Fazekas 9 years ago updated by Ragnar Karlsson 8 years ago 3

I'm trying to set up a "testing ground" for websites (I experiment with Wordpress to create demos for prospective clients), and I installed Ajenti V on Debian 7.

I created a website for a blog, and all's going well until I try to install WP. It's supposed to be living at "mydomain/site", which works, but when I click on "create configuration file" it changes the url to "mydomain/wp-admin" and from that point on there is no changing it.

I admit I'm used to working with Apache and nginx is a new thing for me, but I can't figure out what to change so it works the way I want it to work.

I followed the instructions in the KB to set up the site.

Any help appreciated!
Under review
I suggest trying to set WP_HOME or WP_SITEURL appropriately in the wp-config.php file in your Wordpress directory.
Thanks, but that's the problem - I don't have a wp-config.php, because the setup is supposed to create one, but it reverts to the main domain instead of staying in the directory.

I'll try going through with the install anyway, and edit the config file after, but there has to be a different problem (probably something extremely simple I'm missing)

In your website settings, advanced tab, do you have a block like this?

location / {

try_files $uri $uri/ /index.php?$args;


If so I have found that adding another block right before this is all that is needed

location /site {

try_files $uri $uri/ /site/index.php?$args;


I'm not entirely sure if there is a more elegant way to do this though.