偽靜態對有利於seo,開啟偽靜態幾乎是每個**必經階段,筆者分享amh面板的偽靜態大全,包括wordpress、phpcms、dede、discuz、ecshop、phpwind、sablog2.0、shopex和typecho等程式amh偽靜態規則:
另外,關於ecs雲伺服器的amh面板使用方法可以參考官方文件:快速使用amh建站 - 阿里雲,阿里雲映象市場自帶amh映象,可以通過更換作業系統(更換作業系統是免費的)的方式一鍵安裝amh面板,更加簡單方便。
if (-f $request_filename/index.html)
if (-f $request_filename/index.php)
if (!-f $request_filename)
rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last;
rewrite ^/list-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last;
rewrite ^/tag-([^\.]*)-([0-9]+)-([0-9]+).html /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3 last;
rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3 last;
rewrite ^/([^\.]*).html /index.php?m=member&c=index&a=$1 last;
rewrite "^/index.html$" /index.php last;
rewrite "^/list-([0-9]+)\.html$" /plus/list.php?tid=$1 last;
rewrite "^/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$" /plus/list.php?tid=$1&totalresult=$2&pageno=$3 last;
rewrite "^/view-([0-9]+)-1\.html$" /plus/view.php?arcid=$1 last;
rewrite "^/view-([0-9]+)-([0-9]+)\.html$" /plus/view.php?aid=$1&pageno=$2 last;
rewrite "^/tags.html$" /tags.php last;
rewrite "^/tag-([0-9]+)-([0-9]+)\.html$" /tags.php?/$1/$2/ last;
rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page\%3d$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
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 ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
if (!-e $request_filename)
if (!-e $request_filename)
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/******/([a-z0-9\_]+\.html)$ $1/******/index.php?$2 last;
# 只帶月份的歸檔
rewrite "^/date/([0-9])/?([0-9]+)?/?$" /index.php?action=article&setdate=$1&page=$2 last;
# 無分類翻頁
rewrite ^/page/([0-9]+)?/?$ /index.php?action=article&page=$1 last;
# 分類
rewrite ^/category/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&cid=$1&page=$2 last;
rewrite ^/category/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&curl=$1&page=$2 last;
# 歸檔、高階搜尋
rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last;
rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1&page=$2 last;
# tags
rewrite ^/tag/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&item=$1&page=$2 last;
# 文章
rewrite ^/archives/([0-9]+)/?([0-9]+)?/?$ /index.php?action=show&id=$1&page=$2 last;
# rss rewrite ^/rss/([0-9]+)?/?$ /rss.php?cid=$1 last;
rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last;
# 使用者 rewrite ^/uid/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&uid=$1&page=$2 last;
rewrite ^/user/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&user=$1&page=$2 last;
# 地**件
rewrite sitemap.xml sitemap.php last;
# 自定義鏈結
rewrite ^(.*)/([0-9a-za-z\-\_]+)/?([0-9]+)?/?$ $1/index.php?action=show&alias=$2&page=$3 last;
if (!-e $request_filename)
if (-f $request_filename/index.html)
if (-f $request_filename/index.php)
if (!-f $request_filename)
以上為amh面板的wordpress、phpcms、dede、discuz、ecshop、phpwind、sablog2.0、shopex和typecho等程式amh偽靜態規則。 PHPCMSv9 nginx 偽靜態URL規則
rewrite content 0 9 0 9 0 9 html index.php?m content c index a show catid 1 id 2 page 3 last rewrite show 0 9 0 9 0 9 html index.php?m content c index...
偽靜態的實現
所謂的偽靜態頁面,就是指的url重寫,在asp.net中實現非常簡單 首先你要在你的專案裡引用兩個dll actionlessform.dll urlrewriter.dll 真正實現重寫的是 urlrewriter.dll 但是如果你要實現分頁,那麼必須使用這個actionlessform dll...
yii實現偽靜態
一 調整apache配置檔案httpd.conf,重啟apache伺服器。1.裝載rewrite module模組 loadmodule rewrite module modules mod rewrite.so 2.相對應目錄的allowoverride修改為all documentroot us...