drupal再nginx下开启rewrite简介链接
来源:互联网 发布:卖家淘宝店名可以改吗 编辑:程序博客网 时间:2024/06/01 07:57
原文链接:http://www.drupalproject.org/document/2014/06/nginx_config_for_drupal
drupal再nginx下开启rewrite简洁链接
环境配置:debian7.6 + nginx1.2.1+php5
Nginx开启方法:
在你的nginx配置文件(nginx/sites-available/default)下添加(红色部分):
server {
...
location / {
...
try_files $uri @rewrite;
}
...
location @rewrite {
# For Drupal 7
# 对于Drupal项目位于根目录的情况,e.g /document_root/drupal_project_files
#rewrite ^ /index.php;
# 对于Drupal项目位于根目录下子目录的情况,e.g /document_root/sub_dir/drupal_project_files
rewrite ^/([^/]*)/(.*)(/?)$ /$1/index.php?q=$2&$args;
# For Drupal 6 and below:
#rewrite ^/(.*)$ /index.php?q=$1;
}
...
}
//-------------------------------------------------
// 备注:default 全文
//-------------------------------------------------
server {
root /usr/share/nginx/www;
index index.html index.htm index.php;
server_name localhost;
location / {
index index.php;
autoindex on;
#try_files $uri $uri/ /index.php;
try_files $uri @rewrite;
}
location ~ .*\.(php|php5)?$
{
root /usr/share/nginx/www/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
location @rewrite{
rewrite ^/([^/]*)/(.*)(/?)$ /$1/index.php?q=$2&$args;
}
}
- drupal再nginx下开启rewrite简介链接
- nginx rewrite规则简介
- apache/nginx 开启rewrite模块,实现链接的跳转/nginx上使用TP框架
- nginx下的rewrite
- drupal 开启简洁链接(ubuntu)
- Nginx 下 WordPress rewrite 规则
- Nginx下的rewrite规则
- ubuntu 下开启 apache 的 rewrite 模式
- Ubuntu下apache rewrite模块开启
- ubuntu下Apache开启rewrite模块
- Ubuntu下Apache开启rewrite模块
- Ubuntu下Apache开启Rewrite模块
- Ubuntu下开启apache的Rewrite模块
- nginx下开启https
- Drupal 7中如何开启简介URL(Clean URL)?
- nginx下codeigniter框架的rewrite规则
- Nginx下codeigniter的rewrite规则配置
- Yii在Nginx下的rewrite配置
- Android:设计之屏幕适配
- cocos: command not found
- xib自定义cell,返回cell高度
- 通过经纬度确定一定范围内哪些门店离客户最近,如1000米内有哪些最近的某某门店
- 常用网址入口
- drupal再nginx下开启rewrite简介链接
- 基于 Lucene 的8 个开源搜索引擎
- autosys虚拟机器名和真实机器名的使用
- 如何用java导出Excel文件
- LaTeX新人教程,30分钟从完全陌生到基本入门
- C语言递归实现打开5个计算器
- 阴影一: Shadow mapping 原理
- SQL server 2008 分页存储过程
- JNI中方法签名