Enable clear urls of drupal

Source: Internet
Author: User
Tags drupal nginx server

The so-called clear urls is like www.drupal.com /? Q = admin is converted to www.drupal.com/admin?this is a good solution for both of them. One is easier to get searched by the engine, and the other is, of course, easy to pull. Haha

If apache is used as the http server, you can directly enable clear urls on drupal,

Administration-> Configureation-> Search and metadata-> Clean URLs, and then directly enable it.

If you are an nginx server, you need to write some content in the configuration file to simulate the apache forwarding function, and add the following content in the server segment.

Server {
Listen 80;
...

Location /{
Index index.html index.htm index. php;
Try_files $ uri @ rewrite;
}

Location @ rewrite {
Rewrite ^/(. *) $/index. php? Q = $1;
}

...

}

1. Create a section of location @ rewrite, describe the forwarding rule, and 2. Add the try_files statement using the forwarding rule in the location/section. Restart nginx and enable it in drupal. clear urls Functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.