产品使用及交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

[已解决]:怎么把index.aspx和index.html重定向到/ [复制链接]

1#
近日发现,index.html和index.aspx和域名/都有权重,而且权重不同,想把index.html和index.aspx重新定位到/,不知道怎么操作?

人家php的程序用以下代码做了重定向,不知道我们的.NET语言怎么做?
if(isset($_GET['upcache']))
{
        require_once (dirname(__FILE__) . "/include/common.inc.php");
        require_once DEDEINC."/arc.partview.class.php";
        $GLOBALS['_arclistEnv'] = 'index';
        $row = $dsql->GetOne("Select * From `#@__homepageset`");
        $row['templet'] = MfTemplet($row['templet']);
        $pv = new PartView();
        $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
        $pv->SaveToHtml(dirname(__FILE__).'/index.html');
        include(dirname(__FILE__).'/index.html');
        exit();
}
else
{
        header('HTTP/1.1 301 Moved Permanently');
        header('Location:index.html');
}

也有人说在rewriter里写入:
RewriteRule ^index/.php$ http://域名/ [R=301,L]
同样是PHP语言的,不知道.NET里面怎么写?

已经自己解决了
分享 转发
TOP
2#

回复 2# zengrenrui 的帖子

在rewriter里写入RewriteRule ^/index.aspx$ \$1 [L,R=301]
TOP
3#

就把/index.htm和/交换下位置
TOP
发新话题 回复该主题