20 messages in ru.sysoev.nginxRe: wordpress rewrite nginx
FromSent OnAttachments
Anonymous CowardFeb 12, 2007 3:48 pm 
Scott YangFeb 12, 2007 3:52 pm 
Anonymous CowardFeb 13, 2007 4:48 am 
Igor SysoevFeb 13, 2007 4:59 am 
Anonymous CowardFeb 13, 2007 5:46 am 
Igor SysoevFeb 13, 2007 6:14 am 
Anonymous CowardFeb 13, 2007 6:20 am 
Per JonssonFeb 13, 2007 6:33 am 
Anonymous CowardFeb 13, 2007 7:13 am 
Igor SysoevFeb 13, 2007 7:29 am 
Anonymous CowardFeb 13, 2007 7:42 am 
Igor SysoevFeb 13, 2007 11:31 am 
Jonathan VanascoFeb 13, 2007 12:13 pm 
Anonymous CowardFeb 14, 2007 2:08 am 
Igor SysoevFeb 14, 2007 5:21 am 
Igor SysoevFeb 14, 2007 5:27 am 
Anonymous CowardFeb 14, 2007 5:56 am 
Kirill T.Nov 10, 2007 6:21 pm 
HoneNov 11, 2007 7:54 pm 
Kirill T.Nov 14, 2007 3:21 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: wordpress rewrite nginxActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Feb 14, 2007 5:27:01 am
List:ru.sysoev.nginx

On Wed, Feb 14, 2007 at 04:21:49PM +0300, Igor Sysoev wrote:

On Wed, Feb 14, 2007 at 12:09:05PM +0200, Anonymous Coward wrote:

Let's start from the scratch:

1) set the root at server level, 2) and move all if/rewrite rules to server level, then they will run only once:

server { ...

root /var/www/localhost/htdocs/sub.domain.tld;

#uploaded files rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2;

- rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2; + rewrite ^.*/files/(.*) /wp-content/blogs.php?file=$1;

if (!-e $request_filename) { rewrite ^.+?(/wp-.*) $2 last; rewrite ^.+?(/.*\.php)$ $2 last;

- rewrite ^.+?(/wp-.*) $2 last; - rewrite ^.+?(/.*\.php)$ $2 last; + rewrite ^.+?(/wp-.*) $1 last; + rewrite ^.+?(/.*\.php)$ $1 last;

rewrite ^ /index.php last; }

The "^([_0-9a-zA-Z-]+)?(/wp-.*)" does not match "/test130/wp-content/...".

I tried that too, same result... I also looked in access.log and i noticed that i was getting 404 on these files

/test130/wp-content/themes/default/style.css /test130/wp-content/themes/default/images/kubrickbg.jpg

On website i was trying to access sub.domain.tld/test130/ (which is a blog in Wordpress Mu) and on the server the files were in

$documentroot/wp-content/themes/home/images/kubrickbg.jpg $documentroot/wp-content/themes/default/images/kubrickbg.jpg

$documentroot/wp-content/themes/home/style.css $documentroot/wp-content/themes/default/style.css $documentroot/wp-content/themes/classic/style.css

Maybe this will clear something...

It's seems that "^([_0-9a-zA-Z-]+)?(/wp-.*)" are static files, so "break"

stops rewrite cycle. The "last" continues rewrite cycle and request will go to "location ~ .php$".