oOo--STAR--oOo
oOo--STAR--oOo

Reputation: 438

Nginx wordpress multi site rewrite rules for subdir install

I am trying to set the rewrite rules in NGINX and I currently have some set for location / { already for my main website on that domain. I would like to insall wordpress in a different folder so my location / { needs to be location /page {

I can't seem to set the rewrite rules up for this? Any help would be great I have tried.

Rewrite rules for wordpress 3.0 (multi-site) for nginx?

Doesn't seem to work.

Using this < I can get the page to show up for each user but with no images, css all the other files needed. Its only in plain text.

location /page {
     root  /home/domain/public_html;
     index  index.html index.htm index.php;

     if (!-e $request_filename ) {
        rewrite ^/page/(.*)$ /page/1$ last;
     }
}

I need some rules that can be used for the /page location.

Upvotes: 2

Views: 1546

Answers (1)

rahul286
rahul286

Reputation: 949

You have a small typo:

Rather than using:

rewrite ^/page/(.*)$ /page/1$ last;

Please try:

rewrite ^/page/(.*)$ /page/$1 last;

Regex captures value is $1, not in 1$ ;-)

You will need to change few more things. Here is a complete config - http://rtcamp.com/tutorials/wordpress-nginx-multisite-subdirectories-in-subdirectory-itself/

Upvotes: 2

Related Questions