首先请远程登陆服务器, 

本方法适用windows2003+iis6.0的系统,windows2008+iis7需要联系程序方提供对应的规则,直接将web.config上传到网站根目录,linux系统直接上传.htaccess到网站根目录。


1、打开网站管理助手点击创建站点进行创建,如果已经创建,双击站点进行编辑。


伪静态组建这栏选择对应的系统,如果没有您的程序系统,请选择自定义。


网站管理助手4.0版本的设置位置,如果没有您程序对应的规则,选择diy

4.0.jpg 


2、开启以后,用记事本打开编辑修改网站目录others里面的httpd.conf,这里以站点名为test举例,文件路径就是D:\wwwroot\test\others,注意httpd.conf里面顶部两行不能替换,规则替换为自己的即可。

常见的一些系统规则 

linux系统的伪静态比较简单,一般程序商都直接提供了.htaccess放到网站根目录下即可自动识别,我司自带环境的系统

默认都开启了rewrite模块支持的


301设置:

按上述方法开启好组件,然后添加301转向规则到httpd.conf里面,cctv.com替换为自己的域名,规则如下:

#此规则表示站点上所有域名都301跳转到www.cctv.com
RewriteCond %{HTTP_HOST} !^www.cctv.com$ [NC]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]

#此规则表示如果访问是cctv.com就跳转到www.cctv.com,有多个就复制多组规则
RewriteCond %{HTTP_HOST} ^cctv.com$ [NC]
RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]

Linux系统301设置:

将以下规则添加到.htaccess文件。

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^cctv.com$ [NC]

RewriteRule ^(.*)$ http://www.cctv.com/$1 [R=301,L]

</IfModule>

cctv.com替换为自己的域名,表示将cctv.com重定向到www.cctv.com

2008系统通过web.config实现301,请将abc.com替换为自己的域名

<?xml version="1.0" encoding="UTF-8"?><configuration>    <system.webServer>        <rewrite>            <rules>                <rule name="301Redirect" stopProcessing="true">                    <match url="(.*)" />                    <conditions logicalGrouping="MatchAny">                        <add input="{HTTP_HOST}" pattern="^abc.com$" />                    </conditions>                    <action type="Redirect" url="http://www.abc.com/{R:0}" redirectType="Permanent" />                </rule>            </rules>        </rewrite>    </system.webServer></configuration>
西部数码主机空间到  西部数码代理,思朴互联:http://www.pu263.com/


西部数码主机空间到 西部数码代理,思朴互联: http://www.pu263.com/

名字:

个人主页地址:

E-mail:

评论列表