使用教程

品优影视伪静态设置

2020-02-26 11:43:11

.htaccess   根目录 伪静态文件

 

伪静态 代码    .htaccess(文件)        Apache

RewriteEngine on
RewriteRule ^index.html$ index.php
RewriteRule ^tv.html$ index.php?c=tv
RewriteRule ^form_(.*).html$ index.php?c=form&mid=$1
RewriteRule ^type-(.*).html$ index.php?c=vodlist&type=$1
RewriteRule ^cx.html$ index.php?c=cx
RewriteRule ^cx_(.*)_(.*).html$ index.php?c=cx&m=index&type=$1&page=$2
RewriteRule ^cxshow_(.*).html$ index.php?c=cxplay&m=index&id=$1
RewriteRule ^cxplay_(.*)_(.*)_(.*).html$ index.php?c=cxplay&m=play&id=$1&sid=$2&xl=$3
RewriteRule ^type_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).html$ index.php?c=vodlist&m=index&type=$1&rank=$2&area=$3&year=$4&act=$5&cat=$6&page=$7
RewriteRule ^show(.*)$ index.php?c=vodshow&m=index&play=$1
RewriteRule ^paly(.*)_(.*)_(.*).html$ index.php?c=vodshow&m=play&play=$1&id=$2&xl=$3
RewriteRule ^play_(.*)_(.*)_(.*)$ index.php?c=vodshow&m=play&id=$1&xl=$2&play=$3
RewriteRule ^list-(.*).html$ index.php?c=category&id=$1
RewriteRule ^starlist(.*).html$ index.php?c=star&page=$1
RewriteRule ^star_(.*).html$ index.php?c=star&m=detail&kw=$1
RewriteRule ^member.html$ index.php?s=member
RewriteRule ^search_(.*).html$ index.php?c=search&mid=vods&keyword=$1
RewriteRule ^news_(.*).html$ index.php?c=newslist&page=$1
RewriteRule ^news(.*)$ index.php?c=newslist&m=content&newsid=$1


 

伪静态 代码    .htaccess(文件)        Nginx

 

# nginx configuration by winginx.com

location = /index.html {
  rewrite ^(.*)$ /index.php;
}

location = /tv.html {
  rewrite ^(.*)$ /index.php?c=tv;
}

location /form_ {
  rewrite ^/form_(.*).html$ /index.php?c=form&mid=$1;
}

location /type {
  rewrite ^/type-(.*).html$ /index.php?c=vodlist&type=$1;
}

location = /cx.html {
  rewrite ^(.*)$ /index.php?c=cx;
}

location /cx_ {
  rewrite ^/cx_(.*)_(.*).html$ /index.php?c=cx&m=index&type=$1&page=$2;
}

location /cxshow_ {
  rewrite ^/cxshow_(.*).html$ /index.php?c=cxplay&m=index&id=$1;
}

location /cxplay_ {
  rewrite ^/cxplay_(.*)_(.*)_(.*).html$ /index.php?c=cxplay&m=play&id=$1&sid=$2&xl=$3;
}

location /type_ {
  rewrite ^/type_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).html$ /index.php?c=vodlist&m=index&type=$1&rank=$2&area=$3&year=$4&act=$5&cat=$6&page=$7;
}

location /show {
  rewrite ^/show(.*)$ /index.php?c=vodshow&m=index&play=$1;
}

location /paly {
  rewrite ^/paly(.*)_(.*)_(.*).html$ /index.php?c=vodshow&m=play&play=$1&id=$2&xl=$3;
}

location /play_ {
  rewrite ^/play_(.*)_(.*)_(.*)$ /index.php?c=vodshow&m=play&id=$1&xl=$2&play=$3;
}

location /list {
  rewrite ^/list-(.*).html$ /index.php?c=category&id=$1;
}

location /starlist {
  rewrite ^/starlist(.*).html$ /index.php?c=star&page=$1;
}

location /star_ {
  rewrite ^/star_(.*).html$ /index.php?c=star&m=detail&kw=$1;
}

location = /member.html {
  rewrite ^(.*)$ /index.php?s=member;
}

location /search_ {
  rewrite ^/search_(.*).html$ /index.php?c=search&mid=vods&keyword=$1;
}

location /news_ {
  rewrite ^/news_(.*).html$ /index.php?c=newslist&page=$1;
}

location /news {
  rewrite ^/news(.*)$ /index.php?c=newslist&m=content&newsid=$1;
}


伪静态 代码(Apache转换)    .htaccess(文件)        Nginx

	rewrite ^/index.html$ /index.php;
	rewrite ^/tv.html$ /index.php?c=tv;
	rewrite ^/form_(.*).html$ /index.php?c=form&mid=$1;
	rewrite ^/type-(.*).html$ /index.php?c=vodlist&type=$1;
	rewrite ^/cx.html$ /index.php?c=cx;
	rewrite ^/cx_(.*)_(.*).html$ /index.php?c=cx&m=index&type=$1&page=$2;
	rewrite ^/cxshow_(.*).html$ /index.php?c=cxplay&m=index&id=$1;
	rewrite ^/cxplay_(.*)_(.*)_(.*).html$ /index.php?c=cxplay&m=play&id=$1&sid=$2&xl=$3;
	rewrite ^/type_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).html$ /index.php?c=vodlist&m=index&type=$1&rank=$2&area=$3&year=$4&act=$5&cat=$6&page=$7;
	rewrite ^/show(.*)$ /index.php?c=vodshow&m=index&play=$1;
	rewrite ^/paly(.*)_(.*)_(.*).html$ /index.php?c=vodshow&m=play&play=$1&id=$2&xl=$3;
	rewrite ^/play_(.*)_(.*)_(.*)$ /index.php?c=vodshow&m=play&id=$1&xl=$2&play=$3;
	rewrite ^/list-(.*).html$ /index.php?c=category&id=$1;
	rewrite ^/starlist(.*).html$ /index.php?c=star&page=$1;
	rewrite ^/star_(.*).html$ /index.php?c=star&m=detail&kw=$1;
	rewrite ^/member.html$ /index.php?s=member;
	rewrite ^/search_(.*).html$ /index.php?c=search&mid=vods&keyword=$1;
	rewrite ^/news_(.*).html$ /index.php?c=newslist&page=$1;
	rewrite ^/news(.*)$ /index.php?c=newslist&m=content&newsid=$1;


        宝塔工具箱 伪静态转换

        https://www.bt.cn/Tools/apache_to_nginx

  • 本工具不校验转换结果的正确性,请务必自行校验

  • 若转换效果不理想,我们推荐您尝试使用此工具:http://winginx.com/en/htaccess

 

伪静态 代码 个别主机使用 web.config 文件伪静态根目录建立文件 web.config 使用文本加入下面代码

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="tool.apizl.com rewriteTools1" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^index.html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools2" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^tv.html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=tv" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools3" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^form_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=form&amp;mid={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools4" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^type-(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=vodlist&amp;type={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools5" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^cx.html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=cx" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools6" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^cx_(.*)_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=cx&amp;m=index&amp;type={R:1}&amp;page={R:2}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools7" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^cxshow_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=cxplay&amp;m=index&amp;id={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools8" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^cxplay_(.*)_(.*)_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=cxplay&amp;m=play&amp;id={R:1}&amp;sid={R:2}&amp;xl={R:3}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools9" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^type_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=vodlist&amp;m=index&amp;type={R:1}&amp;rank={R:2}&amp;area={R:3}&amp;year={R:4}&amp;act={R:5}&amp;cat={R:6}&amp;page={R:7}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools10" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^show(.*)" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=vodshow&amp;m=index&amp;play={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools11" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^paly(.*)_(.*)_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=vodshow&amp;m=play&amp;play={R:1}&amp;id={R:2}&amp;xl={R:3}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools12" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^list-(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=category&amp;id={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools13" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^starlist(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=star&amp;page={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools14" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^star_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=star&amp;m=detail&amp;kw={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools15" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^member.html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?s=member" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools16" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^search_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=search&amp;mid=vods&amp;keyword={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools17" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^news_(.*).html" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=newslist&amp;page={R:1}" appendQueryString="false" />
                </rule><rule name="tool.apizl.com rewriteTools18" patternSyntax="ECMAScript" stopProcessing="false">
                    <match url="^news(.*)" ignoreCase="false" />
                    
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="index.php?c=newslist&amp;m=content&amp;newsid={R:1}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
        <httpErrors>

</httpErrors>
    </system.webServer>
</configuration>