您现在的位置是:主页 > news > 事件营销名词解释/seo排名计费系统

事件营销名词解释/seo排名计费系统

admin2025/6/19 7:54:14news

简介事件营销名词解释,seo排名计费系统,做爰试看的网站,wordpress主题分为多章节在Google上搜索的资料很多人都说nginx目前不支持.htaccess文件,我按照nginx的规则试验了一下,结果发现 nginx是完全支持.htaccess文件的!方法如下:1. 在需要使用.htaccess文件的目录下新建一个.htaccess文件,如我的一个…

事件营销名词解释,seo排名计费系统,做爰试看的网站,wordpress主题分为多章节在Google上搜索的资料很多人都说nginx目前不支持.htaccess文件,我按照nginx的规则试验了一下,结果发现 nginx是完全支持.htaccess文件的!方法如下:1. 在需要使用.htaccess文件的目录下新建一个.htaccess文件,如我的一个…

在Google上搜索的资料很多人都说nginx目前不支持.htaccess文件,我按照nginx的规则试验了一下,结果发现 nginx是完全支持.htaccess文件的!
方法如下:
1. 在需要使用.htaccess文件的目录下新建一个.htaccess文件,
如我的一个Discuz论坛目录:

vi /var/www/html/bbs.adocode.com/.htaccess

2. 在里面输入规则,我这里输入Discuz的伪静态规则:

 

# nginx rewrite rule

rewrite ^(.*)/archiver/((fid|tid)-[w-]+.html)$ $1/archiver/index.php?$2 last;

rewrite ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3 last;

rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 last;

rewrite ^(.*)/profile-(username|uid)-(.+).html$ $1/viewpro.php?$2=$3 last;

rewrite ^(.*)/space-(username|uid)-(.+).html$ $1/space.php?$2=$3 last;

rewrite ^(.*)/tag-(.+).html$ $1/tag.php?name=$2 last;

# end nginx rewrite rule

wq保存退出。 
3. 修改nginx配置文件: 

 
vi /etc/nginx/nginx.conf 
4. 在需要添加伪静态的虚拟主机的server{}中引入.htaccess文件, 

 
include /var/www/html/bbs.adocode.com/.htaccess 
include /var/www/html/bbs.adocode.com/.htaccess;(把这个改成你.htaccess文件的具体位置) 
wq保存退出。 
5. 重新加载nginx配置文件:
/etc/init.d/nginx reload 
重新打开网页看看,如果伪静态正常就证明你的rewrite rule语法是正确的。 

 
重写规则各种各样,大家一起交流即可。
原文地址:http://www.adocode.com/code/51

转载于:https://www.cnblogs.com/adocode/archive/2012/10/12/Centos-nginx-htaccess-rewrite.html