Nginx域名重定向,编辑域名配置文件,在server段添加以下内容
if ($host = 'haiyun.me' )
{
rewrite ^/(.*)$ https://www.haiyun.me/$1 permanent;
}
当访问haiyun.me时301重定向为www.haiyun.me
2.当网站目录改变时重定向转移权重
rewrite ^/test/(.*)$ /archives/$1 permanent;
发布时间:February 29, 2012 // 分类:Nginx // No Comments
Nginx域名重定向,编辑域名配置文件,在server段添加以下内容
if ($host = 'haiyun.me' )
{
rewrite ^/(.*)$ https://www.haiyun.me/$1 permanent;
}
当访问haiyun.me时301重定向为www.haiyun.me
2.当网站目录改变时重定向转移权重
rewrite ^/test/(.*)$ /archives/$1 permanent;
发布时间:July 26, 2011 // 分类:伪静态 // No Comments
rewrite /test-(.*)\.htm$ /inc/tesmodrewite.php?q=test_$1;
rewrite /test2-(.*)\.htm$ /inc/tesmodrewite.php?q=test_$1;
rewrite /pm-(.*)\.(jpg|png|gif|html)$ /index.php?pm=$1;
rewrite /pt-(.*)\.(jpg|png|gif|html)$ /index.php?pt=$1;
rewrite /dt-(.*)\.(jpg|png|gif)$ /index.php?dt=$1;
rewrite /dm-(.*)\.(jpg|png|gif)$ /index.php?dm=$1;
rewrite /di-(.*)\.(jpg|jpeg|png|gif|bmp)$ /index.php?di=$1;
rewrite /page(.*)\.html$ /gallery.php?p=$1;