[不花钱站长]:从免费域名开始[0元] Oracle永久免费VPS[0元] VPS环境搭建免费脚本[0元] 秒变大盘挂载免费网盘[0元] 小白免费采集器1天500W[0元] CF免费DNS+CDN服务[0元]
[零基础网赚]:撸本站免费源码[0元] 网站强引免费蜘蛛法[0元] 图片视频文件免费存储[0元] 外链轻松发布免费友链[0元] 入坑免费教程学习源代码[0元] 网上百种+赚钱联盟推荐[?元]

↑↑VPS推荐网 WWW.VPS.COM.IN 稳定 便宜 免备案↑↑


您现在的位置是:首页 > 全球[VPS测评] >  ZBLOG伪静态,伪静态规则,便宜vps,VPS优惠,国外永久免费VPS

ZBLOG PHP程序伪静态规则集合 – Apache/Nginx/IIS/Lighttpd

全球[VPS测评]来源:VPS推荐网点击:652
【性价之王】【线路之王】【价格之王】【配置之王】
【免费之王】【香港首推】【梯子之王】【独服之王】
ZBLOG PHP程序伪静态规则集合 – Apache/Nginx/IIS/Lighttpd

虽然蜗牛部落采用的是WordPress搭建的,但是帮助客户企业网站,以及平时折腾的较多的还是ZBLOG CMS居多,前者稍许用户使用多一些而且插件和主题以及文档较多,对于一个可能比较长久的网站还是比较妥当的,唯一不足的是占用资源比较大。如果我们需要占用资源轻量级CMS,个人比较推荐ZBLOG PHP或者TYPECHO,两者占用资源都比较小的。

无论我们使用哪种CMS建站,要么选择生成静态,要么使用伪静态URL,一来用户体验好一些,二来搜索引擎体验好。一般我们会使用Nginx、Apache、IIS等网站环境,ZBLOG伪静态规则也是我们常用的,在这里蜗牛整理到使用主流的ZBLOG PHP伪静态规则。

第一、Apache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

复制上面内容在网站根目录创建.htaccess文件。

第二、Nginx

if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}

将文件重命名zblog.conf文件,然后放置/usr/local/nginx/conf/目录中,且在当前站点的itbulu.com.conf文件中添加/修改

include /usr/local/nginx/conf/zblog.conf;

第三、Lighttpd

# Rewrite rules
url.rewrite-if-not-file = (

\\”^/(zb_install|zb_system|zb_users)/(.*)\\” => \\”$0\\”,

\\”^/(.*.php)\\” => \\”$0\\”,

\\”^/(.*)$\\” => \\”/index.php/$0\\”

)

在主机控制面板的lighttpd静态规则中加入,或是修改/etc/lighttpd/lighttpd.conf加入上述规则。

第四、IIS7-8

<?xml version=\\”1.0\\” encoding=\\”UTF-8\\”?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=\\”/ Z-BlogPHP Imported Rule\\” stopProcessing=\\”true\\”>
<match url=\\”^.*?\\” ignoreCase=\\”false\\” />
<conditions logicalGrouping=\\”MatchAll\\”>
<add input=\\”{REQUEST_FILENAME}\\” matchType=\\”IsFile\\” negate=\\”true\\” />
<add input=\\”{REQUEST_FILENAME}\\” matchType=\\”IsDirectory\\” negate=\\”true\\” />
</conditions>
<action type=\\”Rewrite\\” url=\\”index.php/{R:0}\\” />
</rule>
<rule name=\\”/ Z-BlogPHP Imported Rule index.php\\” stopProcessing=\\”true\\”>
<match url=\\”^index.php/.*?\\” ignoreCase=\\”false\\” />
<conditions logicalGrouping=\\”MatchAll\\”>
<add input=\\”{REQUEST_FILENAME}\\” matchType=\\”IsFile\\” />
</conditions>
<action type=\\”Rewrite\\” url=\\”index.php/{R:0}\\” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

创建web.config文件并把相关内容复制进去,也可以点击按钮生成。

第五、IIS6

[ISAPI_Rewrite]

RewriteRule /page_([0-9]*)\\\\.html /index\\\\.php\\\\?page=$1&rewrite=1 [I,L]
RewriteRule /date-([0-9\\\\-]+)(?:_)?([0-9]*)\\\\.html /index\\\\.php\\\\?date=$1&page=$2&rewrite=1 [I,L]
RewriteRule /author-([0-9]+)(?:_)?([0-9]*)\\\\.html /index\\\\.php\\\\?auth=$1&page=$2&rewrite=1 [I,L]
RewriteRule /tags-([0-9]+)(?:_)?([0-9]*)\\\\.html /index\\\\.php\\\\?tags=$1&page=$2&rewrite=1 [I,L]
RewriteRule /([^\\\\./_]*)(?:_)?([0-9]*)\\\\.html /index\\\\.php\\\\?cate=$1&page=$2&rewrite=1 [I,L]
RewriteRule /([0-9]+)\\\\.html(\\\\?.*)? /index\\\\.php\\\\?id=$1&rewrite=1 [I,L]
RewriteRule /(?!zb_)(.+)\\\\.html(\\\\?.*)? /index\\\\.php\\\\?alias=$1&rewrite=1 [I,L]

在网站根目录创建httpd.ini文件并把相关内容复制进去,httpd.ini文件必须为ANSI编码,也可以点击按钮生成。

总结,根据我们常用的网站环境安装和设置就可以,蜗牛这边用的多的是Nginx和Apache环境。



猜你可能想看的VPS


转载请注明原文地址:http://140.238.13.167:12355/read-142596.html

下一篇       上一篇