虚拟主机是Linux系统,网站程序的运行环境是php+mysql,怎样设置伪静态???

虚拟主机是Linux系统,网站程序的运行环境是php+mysql,怎样设置伪静态???,第1张

你好,这个得根据你的网站程序和WEB服务器环境来设置伪静态的,比如你用LNMP环境,而用的PHP程序是DZ2.5那么你的伪静态就可以为:

rewrite

^([^\.]*)/topic-(.+)\.html$

$1/portal.php?mod=topic&topic=$2last

rewrite

^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$

$1/portal.php?mod=view&aid=$2&page=$3

last

rewrite

^([^\.]*)/forum-(\w+)-([0-9]+)\.html$

$1/forum.php?mod=forumdisplay&fid=$2&page=$3

last

rewrite

^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$

$1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3

last

rewrite

^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$

$1/forum.php?mod=group&fid=$2&page=$3

last

rewrite

^([^\.]*)/space-(username|uid)-(.+)\.html$

$1/home.php?mod=space&$2=$3

last

rewrite

^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$

$1/home.php?mod=space&uid=$2&do=blog&id=$3

last

rewrite

^([^\.]*)/(fid|tid)-([0-9]+)\.html$

$1/index.php?action=$2&value=$3

last

rewrite

^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$

$1/plugin.php?id=$2:$3

last

if

(!-e

$request_filename)

{

return

404

}

有问题可以+Q+群222802357找群主吧。

第一步,确定空间支持伪静态。

第二步,修改根目录下的htaccess.txt为

<FilesMatch "\.(bak|inc|lib|sh|tpl|lbi|dwt)$">

order deny,allow

deny from all

</FilesMatch>

RewriteEngine On

RewriteBase /

# direct one-word access

RewriteRule ^index\.html$index\.php [L]

RewriteRule ^category$ index\.php [L]

# access any object by its numeric identifier


欢迎分享,转载请注明来源:夏雨云

原文地址:https://www.xiayuyun.com/zonghe/60907.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-02-27
下一篇2023-02-27

发表评论

登录后才能评论

评论列表(0条)

    保存