郧阳涛哥博客原创的时候,发现域名86719.cn老是不能跳转到www.86719.cn,造成了不少流量的浪费损失,为了避免这一流量损失,涛哥查找了N多的技术资料,最终发现相关的伪静态规则需要如下写法,当然使用的一环境不同也不竞相同,下述Z-Blog博客linux系统nginx伪静态规则仅供各位博友参考。
if ($host = '86719.cn' ) { rewrite (.*)$ https://www.86719.cn$1 permanent; } if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; }
相应伪静态管理中心配置规则如下:
·文章的URL配置{%host%}blog/{%id%}.html ·页面的URL配置{%host%}{%alias%}/ ·首页的URL配置{%host%}page_{%page%}.html ·分类页的URL配置{%host%}{%alias%}/{%page%}/ ·标签页的URL配置{%host%}tags-{%id%}_{%page%}.html ·日期页的URL配置{%host%}date-{%date%}_{%page%}.html ·作者页的URL配置{%host%}author-{%id%}_{%page%}.html
有好的文章希望郧阳涛哥帮助分享或推广,请猛戳我要投稿图标。我要投稿
还没有评论,来说两句吧...