从apache到nginx:wordpress重写规则

前端之家收集整理的这篇文章主要介绍了从apache到nginx:wordpress重写规则前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在从apache2迁移到Nginx.我无法弄清楚如何重写wordpress的重写规则.

这实际上是我的配置文件

@H_404_7@server { listen 80; root /usr/share/Nginx/blog.com/public_html; index index.html index.htm index.PHP; server_name blog.com www.blog.com; location / { try_files $uri $uri/ /index.html; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } location ~ .PHP${ fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /usr/share/Nginx/blog.com/public_html$fastcgi_script_name; fastcgi_index index.PHP; include fastcgi_params; } }

我正在使用PHP5-fpm.

这是我想补充的规则:

@H_404_7@# BEGIN wordpress PHP$- [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.PHP [L] wordpress

你能帮我么?谢谢 :)

最佳答案
你应该阅读http://wiki.nginx.org/WordPress

例如

@H_404_7@ location /blog { try_files $uri $uri/ /blog/index.PHP?$args; } location ~ \.PHP${ fastcgi_split_path_info ^(/blog)(/.*)$; }
原文链接:https://www.f2er.com/nginx/434675.html

猜你在找的Nginx相关文章