网络技术

NGINX环境下drupal程序的伪静态设置方法

安装了drupal之后,想去看看“帮助”,在website/admin/help页面。但是点了一下404了如上图。
上图的admin/*都无法访问如下图,但是我觉得可以用website/index.php/admin/help,实测可用,但是还是设置一下伪静态吧。

伪静态规则如下,再次实测可用

location ~ ^.*/files\/styles\/.*$ {
access_log off;
expires 45d;
error_page 404 @drupal;
}

location @drupal {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
# Drupal Rewrite
location / {
root /path/to/drupal;
index index.php index.html;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
}
}

63 thoughts on “NGINX环境下drupal程序的伪静态设置方法

  1. Good post. I learn something new and challenging on blogs I stumbleupon everyday.
    It will always be useful to read articles from other authors
    and practice a little something from other web sites.

  2. Hi, i think that i saw you visited my web site so i came to “return the favor”.I am attempting to find things to improve my web site!I
    suppose its ok to use some of your ideas!!

  3. Hey! I just wanted to ask if you ever have any problems with hackers?
    My last blog (wordpress) was hacked and I ended up losing months of hard work due to no
    backup. Do you have any methods to stop hackers?

  4. Thank you, I’ve just been searching for information about this subject for ages and yours is
    the best I have found out so far. However, what in regards to the conclusion? Are you sure in regards to the
    source?

  5. I’m extremely impressed along with your writing skills and also with the
    format on your blog. Is this a paid subject or did you modify it your self?
    Anyway keep up the excellent quality writing,
    it is uncommon to see a great weblog like this one nowadays..

  6. Just want to say your article is as surprising. The clarity in your
    post is just spectacular and i can assume you are an expert on this subject.
    Well with your permission allow me to grab your feed to keep up to date with forthcoming post.

    Thanks a million and please continue the rewarding work.

  7. My brother suggested I might like this blog. He used to be totally right.
    This publish actually made my day. You cann’t imagine just
    how much time I had spent for this info! Thanks!

  8. Hello would you mind letting me know which webhost you’re utilizing?
    I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot faster then most.
    Can you recommend a good web hosting provider at a fair price?
    Cheers, I appreciate it!

  9. Hi there I am so delighted I found your website,
    I really found you by error, while I was looking
    on Yahoo for something else, Anyhow I am here now and would just like to say thanks for a tremendous post and a all round
    thrilling blog (I also love the theme/design), I don’t have time to read through it
    all at the moment but I have book-marked it and
    also included your RSS feeds, so when I have time I will be back to read a lot more,
    Please do keep up the superb job.

  10. It’s the best time to make some plans for the future and it’s time to be happy.

    I’ve read this post and if I could I want to
    suggest you few interesting things or advice. Maybe you could
    write next articles referring to this article. I want
    to read more things about it!

  11. You really make it seem so easy with your presentation but I
    find this matter to be really something which I think
    I would never understand. It seems too complicated and very broad for
    me. I’m looking forward for your next post, I’ll try to get the hang of
    it!

  12. I was wondering if you ever considered changing the page layout of your website?
    Its very well written; I love what youve got to say.

    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or 2 images.
    Maybe you could space it out better?

  13. It is the best time to make some plans for the future and it’s time to be happy.

    I have read this post and if I could I desire to suggest you few interesting things or suggestions.
    Maybe you could write next articles referring to this article.
    I want to read even more things about it!

  14. Hello just wanted to give you a quick heads up. The words
    in your content seem to be running off the screen in Chrome.
    I’m not sure if this is a formatting issue or something to do with web browser compatibility but
    I thought I’d post to let you know. The layout look
    great though! Hope you get the problem resolved soon. Cheers

  15. Great work! This is the kind of information that are supposed to be
    shared around the web. Disgrace on the search engines for no longer positioning this put up upper!

    Come on over and seek advice from my web site .
    Thanks =)

发表评论

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

返回顶部