Welcome! Log In Create A New Profile

Advanced

Location regexp with multiple Wordpress install

June 01, 2011 05:59AM
Hello,

I have a problem with my location rules.
I would like to generate a generic location rule for each folder that contains a WordPress installation.

location / {
try_files $uri $uri/ /index.html;
}

location /user1/ {
try_files $uri $uri/ /user1/index.php?q=$uri&$args;
}

location ~* ^/(user2|user3)/ {
try_files $uri $uri/ /$1/index.php?q=$uri&$args;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}

If I go to localhost/user1/, I am redirected to the good Wordpress. But, if I go to localhost/user2/ my browser downloads a file containing the source code of index.php.
How to get it working?

Thank you.
Subject Author Posted

Location regexp with multiple Wordpress install

Amanager June 01, 2011 05:59AM

Re: Location regexp with multiple Wordpress install

Igor Sysoev June 01, 2011 06:10AM

Re: Location regexp with multiple Wordpress install

Amanager June 01, 2011 07:35AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready