Nginx中wordpress伪静态规则配置

共356个字

nginx version: nginx/1.10.0 (Ubuntu)

/etc/nginx/sites-enabled/default

在 Server{  

###伪静态规则配置

rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;

                if (!-e $request_filename) {

                rewrite ^.+?(/wp-.*) $1 last;

                rewrite ^.+?(/.*\.php)$ $1 last;

                rewrite ^ /index.php last;

        }

}

然后用命令/etc/nit.d/nginx restart 重启即可

 

文章已同步发布至个人网站 https://www.wuxiaobai.win

❤ 喜欢 218

11条回应:“Nginx中wordpress伪静态规则配置”

  1. Wow, that's what I was seeking for, what a information! existing here at this
    webpage, thanks admin of this web page.

  2. You actually make it seem so easy along with your presentation however I to find
    this topic to be really something that I think
    I might never understand. It sort of feels too complicated and very huge for me.

    I'm having a look forward in your next put up, I'll try
    to get the hang of it!

  3. This is really attention-grabbing, You're an overly professional blogger.
    I've joined your rss feed and look ahead to searching for
    extra of your great post. Additionally, I have
    shared your web site in my social networks

  4. Hey there! Do you know if they make any plugins to help with SEO?
    I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains.

    If you know of any please share. Kudos!

  5. Woah! I'm really enjoying the template/theme
    of this site. It's simple, yet effective. A lot of times it's hard to get that "perfect balance" between user friendliness and
    visual appearance. I must say you've done a fantastic
    job with this. Also, the blog loads very fast for me on Opera.
    Excellent Blog!

  6. What's up, this weekend is pleasant designed for me, because this occasion i am reading this enormous
    educational paragraph here at my residence.

  7. Does your website have a contact page? I'm having a tough time locating it but, I'd like to send you an email.
    I've got some recommendations for your blog you might be interested in hearing.
    Either way, great website and I look forward to seeing
    it grow over time.

  8. Do you mind if I quote a couple of your posts as long as I provide credit and sources
    back to your webpage? My website is in the exact
    same niche as yours and my users would really benefit from a lot of the information you provide here.
    Please let me know if this ok with you. Appreciate it!

  9. Hello there! Quick question that's completely
    off topic. Do you know how to make your site mobile friendly?
    My web site looks weird when browsing from my apple
    iphone. I'm trying to find a template or plugin that might be able to
    fix this issue. If you have any recommendations, please share.

    Cheers!

发表评论

电子邮件地址不会被公开。 必填项已用*标注

归档于 Ubuntu