Thank you Igor,<br><br>I tried your suggestion too but i have the same behavoir with the exception that now i see few more images but the design is still screwed.<br>I added just the rules from "#uploaded files" down because im testing the blog in a subdomain now so the www thing is not needed and i would've used the virtual hosts to handle it anyway.
<br>I doubt that it's a problem with the files or anything because im using the same directory for Apache and it works ok with the rules i mentioned... and in nginx the first page looks ok, only posts and other blogs that should use the rewrite are screwed.
<br><br>Just to be sure im posting my nginx config (from server directive down):<br><br> server {<br> listen my.ip.here;<br> server_name sub.domain.tld;<br><br> access_log /var/log/nginx/subdomain.access_log main;
<br> error_log /var/log/nginx/subdomain.error_log;<br><br> rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2;<br><br> if (!-e $request_filename) {<br> rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
<br> rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last;<br> rewrite ^ /index.php last;<br> }<br> location / {<br> root /var/www/localhost/htdocs/sub.domain.tld;
<br> allow <a href="http://192.168.2.0/24">192.168.2.0/24</a>;<br> deny all;<br> }<br> location ~ .php$ {<br> include /etc/nginx/fastcgi_params;<br> fastcgi_pass
<a href="http://127.0.0.1:1105">127.0.0.1:1105</a>;<br> fastcgi_index index.php;<br><br> # where the php files to pass to the listener.<br> fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/subdomain.tld$fastcgi_script_name;
<br> }<br> }<br>}<br><br><br><div><span class="gmail_quote">On 2/13/07, <b class="gmail_sendername">Igor Sysoev</b> <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Feb 13, 2007 at 01:48:57AM +0200, Anonymous Coward wrote:<br><br>> i installed Wordpress today on nginx and everything seems ok except one<br>> "small" issue, i don't know how to convert the rewrite rules.
<br>> So if anybody has any experience or knows how to do it i'd be gratefull<br>> cause they have only Apache examples :(<br>><br>> RewriteEngine On<br>> RewriteBase /<br>><br>> # Rewrite <a href="http://www.domain.com">
www.domain.com</a> to <a href="http://domain.com">domain.com</a><br>> RewriteCond %{HTTP_HOST} ^www\.(.*)<br>> RewriteRule ^(.*) http://%1/$1 [R,L]<br>><br>> #uploaded files<br>> RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]
<br>><br>> RewriteCond %{REQUEST_FILENAME} -f [OR]<br>> RewriteCond %{REQUEST_FILENAME} -d<br>> RewriteRule . - [L]<br>> RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]<br>> RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
<br>> RewriteRule . index.php [L]<br><br><br> server {<br> ...<br><br> # Rewrite <a href="http://www.domain.com">www.domain.com</a> to <a href="http://domain.com">domain.com</a><br> if ($http_host ~ "^www\.(.*)") {
<br> set $name $1;<br> rewrite ^(.*) http://$name/$1;<br> }<br><br> #uploaded files<br> rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2;<br><br> if (!-e $request_filename) {
<br> rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;<br> rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last;<br> rewrite ^ /index.php last;<br>
}<br><br> ...<br> }<br><br>However, it's better to replace the first rule with separate virtual hosts.<br><br><br>--<br>Igor Sysoev<br><a href="http://sysoev.ru/en/">http://sysoev.ru/en/</a><br><br></blockquote>
</div><br>