Nginx   发布时间:2022-05-11  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了从apache到nginx:wordpress重写规则大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

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

这实际上是我的配置文件

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.

这是我想补充的规则:

# BEGIN wordpress
php$- [L]
RewriteCond %{requEST_FILename} !-f
RewriteCond %{requEST_FILename} !-d
RewriteRule . /blog/index.php [L]
wordpress

你能帮我么?谢谢 :)

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

例如

    LOCATIOn /blog {
            try_files $uri $uri/ /blog/index.php?$args;
    }

    LOCATIOn ~ \.php${
            fastcgi_split_path_info ^(/blog)(/.*)$;
    }

大佬总结

以上是大佬教程为你收集整理的从apache到nginx:wordpress重写规则全部内容,希望文章能够帮你解决从apache到nginx:wordpress重写规则所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: