欢迎各位兄弟 发布技术文章
这里的技术是共享的
fzzbxx是使用的windows2003的空间,如果要添加伪静态需要在控制面板开启自定义伪静态后再将伪静态规则添加到others\httpd.conf文件中。
http://www.west263.com/manager/vhost/setIsapi.asp 有介绍
下面是httpd.conf
RegistrationName= wlqcwin
RegistrationCode= 2EAD-35GH-66NN-ZYBA
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
#默认包含了301设置,此设置情况下cctv.com/aa.htm 会301跳至www.cctv.com/aa.htm,将cctv.com替换为您自己的域名就能实现自己的域名的301
RewriteCond %{HTTP:Host} ^fzzbxx.com$
RewriteRule (.*) http://www.fzzbxx.com$1 [NC,R=301]
#这个是手机跳转 肯定是好的
RewriteCond %{HTTP_USER_AGENT} ^.*android.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*blackberry.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*googlebot-mobile.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*iemobile.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*ipad.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*iphone.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*opera mobile.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*palmos.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*symbian.*$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^.*webos.*$ [NC]
RewriteRule ^(.*)$ http://m.szfzxx.com/ [NC,R=301]
66300136使用的是windows2008的空间,伪静态直接添加到wwwroot根目录下的web.config中即可生效。非常感谢您对我司的支持,谢谢!
下面是web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*android.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect1" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*blackberry.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect2" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*googlebot-mobile.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect3" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*iemobile.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect5" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*iphone.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect6" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*opera mobile.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect7" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*palmos.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect8" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*symbian.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="Redirect9" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^.*webos.*$" />
</conditions>
<action type="Redirect" url="http://m.efdrgh.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>