当前位置:Gxlcms > 数据库问题 > tp3.2定义域名修改路径 .htaccess

tp3.2定义域名修改路径 .htaccess

时间:2021-07-01 10:21:17 帮助过:8人阅读

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
#RewriteRule ^m.php(.*)$ m.php/$1 [L]

RewriteCond %{SERVER_PORT} !^443$
# RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

# RewriteRule ^(.*)$ http://www.*****.com$1 [R=301,L]

#RewriteRule ^index.php$ https://www.*****.com [r=301,L,NC]
#RewriteRule ^index.php/index/index$ https://www.*****.com [r=301,L,NC]

#RewriteRule ^index.php/index$ https://www.*****.com [R=301,L,NC]

#RewriteRule "^index.php/dmycy/forum.php(.*)$" "https://www.*****.com" [R=301,L,NC]

Redirect temp https://www.*****.com/new/page/752.html http://www.*****.com/new/page/752.html
order deny,allow


#新闻url 重写-------------------------- start
RewriteRule "^(.*)/new/_([0-9]+)\.html" "$1/new/index/p/$2" [PT]
RewriteRule "^(.*)/new/([0-9]+)-([0-9]+)-([0-9]+)\.html" "$1/new/index/cid/$2/csid/$3/cssid/$4" [PT]
RewriteRule "^(.*)/new/([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)\.html" "$1/new/index/cid/$2/csid/$3/cssid/$4/p/$5" [PT]

RewriteRule "^(.*)/new/_([0-9]+)/" "$1/new/index/p/$2" [PT]
RewriteRule "^(.*)/new/([0-9]+)-([0-9]+)-([0-9]+)/$" "$1/new/index/cid/$2/csid/$3/cssid/$4" [PT]
RewriteRule "^(.*)/new/([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)/" "$1/new/index/cid/$2/csid/$3/cssid/$4/p/$5" [PT]

RewriteRule "^(.*)/new/page/([0-9]+).html" "$1/new/page/id/$2" [PT]
RewriteRule "^(.*)/new/page/([0-9]+).html" "$1/m.php/new/page/id/$2" [PT]
#新闻url 重写-------------------------- end


#视频url 重写-------------------------- start
RewriteRule "^(.*)/move/page/([0-9]+)\.html" "$1/move/page/id/$2" [PT]
RewriteRule "^(.*)/moves/_([0-9]+)\.html" "$1/moves/index/p/$2" [PT]
RewriteRule "^(.*)/moves/([0-9]+)-([0-9]+)\.html" "$1/moves/index/cid/$2/sta/$3" [PT]

RewriteRule "^(.*)/moves/_([0-9]+)/" "$1/moves/index/p/$2" [PT]
RewriteRule "^(.*)/moves/_([0-9]+)" "$1/moves/index/p/$2" [PT]
RewriteRule "^(.*)/moves/([0-9]+)-([0-9]+)/" "$1/moves/index/cid/$2/sta/$3" [PT]
RewriteRule "^(.*)/moves/([0-9]+)-([0-9]+)_([0-9]+)/" "$1/moves/index/cid/$2/sta/$3/p/$4" [PT]
#视频url 重写-------------------------- end

#图片url 重写-------------------------- start
RewriteRule "^(.*)/picture/([0-9]+)-([0-9]+)-([0-9]+)\.html" "$1/picture/index/cid/$2/csid/$3/cssid/$4" [PT]
RewriteRule "^(.*)/picture/([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)\.html" "$1/picture/index/cid/$2/csid/$3/cssid/$4/p/$5" [PT]
RewriteRule "^(.*)/picture/_([0-9]+)\.html" "$1/picture/index/p/$2" [PT]
RewriteRule "^(.*)/picture/page/([0-9]+)\.html" "$1/picture/page/id/$2" [PT]

RewriteRule "^(.*)/picture/([0-9]+)-([0-9]+)-([0-9]+)/$" "$1/picture/index/cid/$2/csid/$3/cssid/$4" [PT]
RewriteRule "^(.*)/picture/([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)/$" "$1/picture/index/cid/$2/csid/$3/cssid/$4/p/$5" [PT]
RewriteRule "^(.*)/picture/_([0-9]+)/$" "$1/picture/index/p/$2" [PT]
RewriteRule "^(.*)/picture/_([0-9]+)$" "$1/picture/index/p/$2" [PT]
#图片url 重写-------------------------- end


#产品url 重写-------------------------- end
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+年+[0-9]+)\.html" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+年+[0-9]+)_([0-9]+)\.html" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/p/$8" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)\.html" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/p/$8" [PT]


#
RewriteRule "^(.*)/product/_([0-9]+)\.html" "$1/product/index/p/$2" [PT]
#
RewriteRule "^(.*)/product/page/([0-9]+).html$" "$1/product/page/id/$2" [PT]
RewriteRule "^(.*)/product/page/([0-9]+)$" "$1/product/page/id/$2" [PT]


#
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+年+[0-9]+)/" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+年+[0-9]+)_([0-9]+)/" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/p/$8" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)/" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)$" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7" [PT]

 

 


RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)/$" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/p/$8" [PT]
RewriteRule "^(.*)/product/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)$" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/p/$8" [PT]

RewriteRule "^(.*)/product/(.*)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)_([0-9]+)/$" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/pname/$8/p/$9" [PT]

RewriteRule "^(.*)/product/(.*)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/(.*)/$" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/pname/$8[tf]$9" [PT]

RewriteRule "^(.*)/product/(.*)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$" "$1/product/index/new/$2/tids/$3/bid/$4/sid/$5/vid/$6/time/$7/pname/$8" [PT]
#
# #新版本url 重写 20171215

# RewriteRule "^(.*)/product/(.*)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$" "$1/product/index/new/$2/tids/$3/tid1/$4/tid2/$5/tid3/$6/bid/$7/sid/$8/vid/$9/time/$10/pname/$11" [PT]

RewriteRule "^(.*)/product/(.*)-([0-9]+,[0-9]+,[0-9]+,[0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)_([0-9]+)/$" "$1/product/index/new/$2/tid/$3/bid/$4/sid/$5/vid/$6/time/$7/pname/$8/p/$9" [PT]


RewriteRule "^(.*)/product/(.*)-([0-9]+,[0-9]+,[0-9]+,[0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$" "$1/product/index/new/$2/tid/$3/bid/$4/sid/$5/vid/$6/time/$7/pname/$8" [PT]

 

 

 

 

RewriteRule "^(.*)/product/_([0-9]+)/" "$1/product/index/p/$2" [PT]
RewriteRule "^(.*)/product/_([0-9]+)" "$1/product/index/p/$2" [PT]
RewriteRule "^(.*)/product/(.*)_([0-9]+)/$" "$1/product/index/pname/$2/p/$3" [PT]

#产品url 重写-------------------------- end


#301重定向

#index.php/home/product/index/new/1/tid/394/bid/1/p/1.html
# RewriteRule ^index.php/Home/Product/index/new/([0-9]+)/p/([0-9]+).html$ https://www.*****.com/product/$1-0-0-0-0-0_$2/ [r=301]
RewriteRule ^index.php/Home/New/index/cid/([0-9]+)/p/([0-9]+).html$ https://www.*****.com/new/$1-0-0_$2/ [r=301]
RewriteRule ^index.php/home/new/index/cid/([0-9]+)/csid/([0-9]+)$ https://www.*****.com/new/$1-$2-0/ [r=301]
RewriteRule ^index.php/Home/new/?cid=([0-9]+)&p=([0-9]+).html$ https://www.*****.com/new/$1-0-0_$2/ [r=301]
RewriteRule ^index.php/new/index/cid/([0-9]+)/csid/([0-9]+)/p/([0-9]+).html$ https://www.*****.com/new/$1-$2-0_$3/ [r=301]
RewriteRule ^index.php/new/index/cid/([0-9]+)$ https://www.*****.com/new/$1-0-0/ [R=301,L]
RewriteRule ^index.php/new/index/cid/([0-9]+)/p/([0-9]+).html$ https://www.*****.com/new/$1-0-0_$2/ [R=301,L]
RewriteRule ^index.php/new/index/cid/([0-9]+).html$ https://www.*****.com/new/$1-0-0/ [R=301,L]
RewriteRule ^index.php/new/index/p/([0-9]+).html$ https://www.*****.com/new/_$1/ [R=301,L]

# RewriteRule ^index.php/home/product/index/new/([0-9]+)/tid/([0-9]+)/bid/1/p/([0-9]+).html$ https://www.*****.com/product/$1-$2-0-0-0-0_$3/ [r=301,L,NC]
# RewriteRule ^index.php/home/product/index/new/([0-9]+)/tid/([0-9]+)$ https://www.*****.com/product/$1-$2-0-0-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/product/index/new/([0-9]+)/tid/([0-9]+)$ https://www.*****.com/product/$1-$2-0-0-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/home/product/index/new/([0-9]+)/tid/([0-9]+).html$ https://www.*****.com/product/$1-$2-0-0-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/Home/product/index/new/([0-9]+)/tid/([0-9]+)/bid/1$ https://www.*****.com/product/$1-$2-0-0-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/product/index/new/1/tid/([0-9]+)/bid/([0-9]+)/sid/([0-9]+)$ https://www.*****.com/product/1-$1-$2-$3-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/Home/product/index/new/([0-9]+)/tid/([0-9]+)/bid/([0-9]+)/sid/([0-9]+)$ https://www.*****.com/product/$1-$2-$3-$4-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/Home/product/index/new/([0-9]+)/tid/([0-9]+)/bid/1/sid/([0-9]+)$ https://www.*****.com/product/$1-$2-0-$3-0-0/ [r=301,L,NC]
# RewriteRule ^index.php/Home/product/index/new/([0-9]+)/tid/([0-9]+)/bid/1/sid/$ https://www.*****.com/product/$1-$2-0-0-0-0/ [r=301,L,NC]

#产品页 老版本 跳转到新版本
# RewriteRule ^index.php/home/product/page/id/([0-9]+)$ https://www.*****.com/product/page/$1.html [r=301,L,NC]
# 产品列表 老版本跳转到新版本
# RewriteRule ^index.php/product/index/new/([0-9]+)/tid/([0-9]+)/bid/1/sid/$ http://www.*****.com/product/$1-$2-0-0-0-0/ [r=301,L,NC]

#视频老连接跳转
RewriteRule ^index.php/move/index$ http://www.*****.com/moves/ [r=301,L,NC]
RewriteRule ^index.php/move$ http://www.*****.com/moves/ [r=301,L,NC]


#新闻详情页 老版本跳转
# RewriteRule ^index.php/home/new/page/id/([0-9]+)$ https://www.*****.com/new/page/$1.html [r=301,L,NC]
# #新闻详情页 老版本跳转
# RewriteRule ^index.php/new/page?id=([0-9]+)$ https://www.*****.com/new/page/$1.html [r=301,L,NC]

#品牌详情页.
RewriteRule "^(.*)/brand/page/([0-9]+).html" "$1/brand/page/id/$2" [PT]
RewriteRule "^(.*)/series/page/([0-9]+).html" "$1/series/page/id/$2" [PT]

 

#关于我们
RewriteRule "^(.*)/other/m-(.*)/" "$1/other/index/mod/$2" [PT]

 

 


</IfModule>

tp3.2定义域名修改路径 .htaccess

标签:重写   tar   ***   product   options   详情   request   --   版本   

人气教程排行