火端huoduan搜索程序伪静态规则

vnweek3年前 (2021-01-20)SEO160

火端搜索程序2.0版伪静态全新调整了,更简单的规则,后台随时自定义伪静态规则,不用再手动修改文件。目录格式还是.html后缀模式有你决定!

例如:

/k/关键词   后台应设置 k/{q} 和 k/{q}/{p}

/关键词.html   后台应设置 {q}.html  和 {q}_{p}.html

/s/关键词.html      后台应设置 s/{q}.html 和 s/{q}_{p}.html

还可以吧“关键词”base64转码,例如:

/5YWz6ZSu6KN.html    后台应设置 {qe}.html  和 {qe}_{p}.html

简单设置伪静态的方法:

1、如果你的环境是Apache

请直接移动程序里伪静态文件夹下的.htaccess文件到根目录来

2、如果你的环境是IIS7.5或者以上版本

请直接移动程序里伪静态文件夹下的.htaccess文件和web.config到根目录来

3、如果你的环境是Nginx

请复制程序里伪静态文件夹下的nginx.txt文件里面的内容到站点配置文件里,然后重启Nginx。如下图:



3、如果你的环境是IIS6.0

请复制程序里伪静态文件夹下的.htaccess文件和httpd.ini到根目录来,由于IIS6下伪静态组件不一样,不一定支持,建议不要使用Win2003+IIS6这种已经淘汰的环境了。

在后台设置伪静态规则的时候,建议使用“/”或者“_”这两个字符来分割,不要用其它特殊字符,以免冲突出错

2.X的程序里已经包含了伪静态规则

以下是2.X版的伪静态规则

Nginx版:

    if (!-e $request_filename) {                rewrite /(.*) /index.php?rewrite=$1  last;    }

Nginx版(放“so”子目录):

    if (!-e $request_filename) {                rewrite /so/(.*) /so/index.php?rewrite=$1  last;    }

请注意:如果设置伪静态后搜索中文乱码,请在规则RewriteRule ^(.*)$ /index.php?rewrite=$1后面加上 [QSA,NU,PT,L]

Apache版(.htaccess文件)

    RewriteEngine On    RewriteBase /    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule ^(.*)$ /index.php?rewrite=$1

Apache版(放“so”子目录)

    RewriteEngine On    RewriteBase /so/    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule ^(.*)$ /so/index.php?rewrite=$1

IIS版,IIS6.0下的httpd.ini伪静态就没有那么灵活了

    [ISAPI_Rewrite]    CacheClockRate 3600    RepeatLimit 32    RewriteRule ^/sitemap/$ /index\.php\?rewrite=sitemap/    RewriteRule ^/sitemap/(.*).html$ /index\.php\?rewrite=sitemap/$1.html    RewriteRule ^/k/(.*)/(.*)$ /\?q=$1&p=$2    RewriteRule ^/k/(.*)$ /\?q=$1

IIS版(放“so”子目录)

    [ISAPI_Rewrite]    CacheClockRate 3600    RepeatLimit 32    RewriteRule ^/so/sitemap/$ /so/index\.php\?rewrite=sitemap/    RewriteRule ^/so/sitemap/(.*).html$ /so/index\.php\?rewrite=sitemap/$1.html    RewriteRule ^/so/k/(.*)/(.*)$ /so/\?q=$1&p=$2    RewriteRule ^/so/k/(.*)$ /so/\?q=$1

IIS7/IIS7.5 web.config规则

    <?xml version="1.0" encoding="UTF-8"?>    <configuration>             <system.webServer>             <security>               <requestFiltering allowDoubleEscaping="true"></requestFiltering>                </security>                <rewrite>             <rules>              <rule name="OrgPage" stopProcessing="true">             <match url="^(.*)$"/>             <conditions logicalGrouping="MatchAll">             <add input="{HTTP_HOST}" pattern="^(.*)$"/>             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>             </conditions>             <action type="Rewrite" url="index.php?rewrite={R:1}"/>              </rule>             </rules>           </rewrite>             </system.webServer>    </configuration>

如果是在so/目录


    <?xml version="1.0" encoding="UTF-8"?>    <configuration>             <system.webServer>                <defaultDocument>                   <files>                     <clear />                     <add value="index.php" />                   </files>                 </defaultDocument>             <security>               <requestFiltering allowDoubleEscaping="true"></requestFiltering>                </security>                <rewrite>             <rules>              <rule name="OrgPage" stopProcessing="true">             <match url="^so/(.*)$"/>             <conditions logicalGrouping="MatchAll">             <add input="{HTTP_HOST}" pattern="^so/(.*)$"/>             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>             </conditions>             <action type="Rewrite" url="so/index.php?rewrite={R:1}"/>              </rule>             </rules>           </rewrite>             </system.webServer>    </configuration>


相关文章

宝塔面板安装z-blog在二级目录伪静态规则设置方法

  前几篇文章介绍过本站的坎坷历史,域名竞拍回来之后,博主马上用之前备份的数据搭建好了网站。由于原来的程序原因,明白的一看就懂了,所以博主想搭建一个博客写一点文章来吸引蜘蛛,最好是安装在二级...

借助YouTube优选提升品牌广告投放成效

借助YouTube优选提升品牌广告投放成效

不知不觉,【Ads on Air 系列】已经陪伴大家到第六期了,之前的几期内容是否给大家带来了一些启发或洞察呢?本期我们邀请到 YouTube 优选的全球产品主管 Jessica O’Brie 和欧洲...

哇力扫地机器人获数千万投资:N1 Max,主打“加压拖地”和“拖布自洗”

哇力扫地机器人获数千万投资:N1 Max,主打“加压拖地”和“拖布自洗”

懒人经济的刺激下,扫地机器人越来越受欢迎。但是让扫地机器人好好拖地不是一件容易的事。它可能只是让拖布轻轻拂过地面,擦不掉顽固污渍;或者是不会自己洗拖布,到后面越拖越脏。2018年,张珂嘉意识到了这个痛...

.guru域名是哪国的,怎么注册

什么是 .guru?.guru为2014年ICANN新通过审核的顶级域名,目前已推出注册服务。guru(专家)是一个特定主题的专家。这使得全新的 .guru 域名成为建议博客和入门...

通过HTML代码实现网站页面外链转内链,防止权重流失

网站内部外链太多的话容易权重流失,下面这个简单的HTML代码可以实现外链转为内链跳转,支持所有网站和程序。将以下代码保存为go.html或者jump.html等等,随意哈,自定义就行,然后放到网站根目...

为网站添加favicon.ico图标

实现的方式有两种 1.其中favicon.ico需放在根目录下面(不提倡用这种方法,因为图片没有授权,违反了W3C标准。 2.这里的favicon必须是16*16或者32*32的,必须...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。