

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
20 messages in ru.sysoev.nginxRe: wordpress rewrite nginx| From | Sent On | Attachments |
|---|---|---|
| Anonymous Coward | Feb 12, 2007 3:48 pm | |
| Scott Yang | Feb 12, 2007 3:52 pm | |
| Anonymous Coward | Feb 13, 2007 4:48 am | |
| Igor Sysoev | Feb 13, 2007 4:59 am | |
| Anonymous Coward | Feb 13, 2007 5:46 am | |
| Igor Sysoev | Feb 13, 2007 6:14 am | |
| Anonymous Coward | Feb 13, 2007 6:20 am | |
| Per Jonsson | Feb 13, 2007 6:33 am | |
| Anonymous Coward | Feb 13, 2007 7:13 am | |
| Igor Sysoev | Feb 13, 2007 7:29 am | |
| Anonymous Coward | Feb 13, 2007 7:42 am | |
| Igor Sysoev | Feb 13, 2007 11:31 am | |
| Jonathan Vanasco | Feb 13, 2007 12:13 pm | |
| Anonymous Coward | Feb 14, 2007 2:08 am | |
| Igor Sysoev | Feb 14, 2007 5:21 am | |
| Igor Sysoev | Feb 14, 2007 5:27 am | |
| Anonymous Coward | Feb 14, 2007 5:56 am | |
| Kirill T. | Nov 10, 2007 6:21 pm | |
| Hone | Nov 11, 2007 7:54 pm | |
| Kirill T. | Nov 14, 2007 3:21 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: wordpress rewrite nginx | Actions... |
|---|---|---|
| From: | Igor Sysoev (is-G...@public.gmane.org) | |
| Date: | Feb 13, 2007 6:14:01 am | |
| List: | ru.sysoev.nginx | |
On Tue, Feb 13, 2007 at 03:47:09PM +0200, Anonymous Coward wrote:
Thank you Igor,
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. 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. 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.
Just to be sure im posting my nginx config (from server directive down):
server { listen my.ip.here; server_name sub.domain.tld;
access_log /var/log/nginx/subdomain.access_log main; error_log /var/log/nginx/subdomain.error_log;
rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2;
if (!-e $request_filename) { rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last; rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last; rewrite ^ /index.php last; } location / { root /var/www/localhost/htdocs/sub.domain.tld; allow 192.168.2.0/24; deny all; } location ~ .php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:1105; fastcgi_index index.php;
# where the php files to pass to the listener. fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/subdomain.tld$fastcgi_script_name; } } }
What is in error_log ?
-- Igor Sysoev http://sysoev.ru/en/
On 2/13/07, Igor Sysoev <is-G...@public.gmane.org> wrote:
On Tue, Feb 13, 2007 at 01:48:57AM +0200, Anonymous Coward wrote:
i installed Wordpress today on nginx and everything seems ok except one "small" issue, i don't know how to convert the rewrite rules. So if anybody has any experience or knows how to do it i'd be gratefull cause they have only Apache examples :(
RewriteEngine On RewriteBase /
# Rewrite www.domain.com to domain.com RewriteCond %{HTTP_HOST} ^www\.(.*) RewriteRule ^(.*) http://%1/$1 [R,L]
#uploaded files RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule . - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L]
server { ...
# Rewrite www.domain.com to domain.com if ($http_host ~ "^www\.(.*)") { set $name $1; rewrite ^(.*) http://$name/$1; }
#uploaded files rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2;
if (!-e $request_filename) { rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last; rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last; rewrite ^ /index.php last; }
... }
However, it's better to replace the first rule with separate virtual hosts.







