使用方法:% Z- C6 A X; q3 S# p- D W
1.上传.htaccess到mymps根目录;& l4 h5 @9 X! c
2.后台开启。
3.缓冲下!* w0 T5 [5 q, X, z8 B
前提:
空间必须支持htaccess解析。这个应该咨询下空间商。7 n/ y4 C$ `/ B+ F
文件代码如下:
-
-
RewriteEngine On
-
RewriteRule ^info-id-([0-9]+)\/$ public/info.php?id=$1
-
RewriteRule ^info-catid-([0-9]+)-page-([0-9]+)\/$ public/info.php?catid=$1&page=$2
-
RewriteRule ^info-catid-([0-9]+)-areaid-([0-9]+)-page-([0-9]+)\/$ public/info.php?catid=$1&areaid=$2&page=$3
-
RewriteRule ^aboutus\/$ public/about.php?part=aboutus2 k! \& v+ x2 p3 O
-
RewriteRule ^aboutus-id-([0-9]+)\/$ public/about.php?part=aboutus&id=$1
-
RewriteRule ^announce-page-([0-9]+)\/$ public/about.php?part=announce&page=$1
-
RewriteRule ^announce-id-([0-9]+)\/$ public/about.php?part=announce&id=$1; F3 Z8 g! `, I: _: M# E
-
RewriteRule ^faq\/$ public/about.php?part=faq! b/ i: C" q! v. Z& _6 b4 V
-
RewriteRule ^faq-id-([0-9]+)\/$ public/about.php?part=faq&id=$1; X' W; H7 e$ L# o) j5 j
-
RewriteRule ^friendlink\/$ public/about.php?part=friendlink
-
RewriteRule ^friendlink-action-apply\/$ public/about.php?part=friendlink&action=apply
-
RewriteRule ^guestbook-page-([0-9]+)\/$ public/about.php?part=guestbook&page=$1& u4 n7 x1 V T; @+ m$ t
-
RewriteRule ^guestbook-action-write\/$ public/about.php?part=guestbook&action=write
-
RewriteRule ^space-([a-z,0-9\-]+)\/$ public/space.php?user=$1
-
复制代码
复制代码到记事本另存为文件名 .htaccess 注意文件类型要选所有类型,要不win系统提示没文件名的哦!% H c- y* }8 s, F/ a
: J3 ]1 N1 F- \6 }
优点:& ` j A; c# u1 V9 ` n8 Z
1.无需繁琐配置,上传即可。; H5 F2 C( z: e6 r' h
2.修复了之前的页面打开无法正常跳转问题,即页面多是一样的问题。
9 P$ t* W. z; y
下期预告,请关注:
1.模板防下载,可以有效防盗。
2.URL标准化问题。
3.图片链接防盗问题。
& t6 c& ?' Y, \" j
评论已关闭!