RewriteEngine On
RewriteBase BASE/
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
在Nginx中会是什么样子呢?
非常感谢,
Eiso
发布于 2010-10-20 12:45:20
发布于 2012-02-18 12:16:15
您应该在您的配置文件中尝试。这对我来说很有效:
location / {
index index.html index.php;
# URLs that don't exist go to WordPress /index.php PHP FastCGI
if (!-e $request_filename) {
rewrite ^.* /index.php break;
fastcgi_pass 127.0.0.1:9001;
}
发布于 2010-05-19 13:12:53
这里有一篇给出重写规则的帖子:http://beatpanda.co.cc/blog/2010/05/16/wordpress-3-0-multisite-rewrite-rules-for-nginx/
然而,当nginx启动时,它会给出以下错误:
root@xxx:/home/xxx/public_html/domain.com/public# /etc/init.d/nginx start启动nginx: emerg: /usr/local/ nginx /sites-enabled/Domain.com中"location“指令中的参数数目无效:33nginx。
https://stackoverflow.com/questions/2865690
复制相似问题