分享

写回答

发帖

[提问] win主机GD的伪静态怎么写?

GoDaddy GoDaddy 2245 人阅读 | 13 人回复

发表于 2010-10-22 21:02:25 | 显示全部楼层 |阅读模式

之前用其他空间win主机用的httpd.ini伪静态文件,放在GD空间里面没有用,可是同样是win主机啊

我在其他win空间里面用的伪静态文件如下:
RewriteRule ^(.*)yoyotaosp/([0-9]+).html$ $1/product.php\?iid=$2 [I]

RewriteRule ^(.*)/yoyotaolb/([0-9]+).html$ $1/list.php\?catid=$2 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-0.html$ $1/list.php\?catid=$2&sort=commissionNum_desc [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-0-([0-9]+)-([0-9]+).html$ $1/list.php\?catid=$2&sort=commissionNum_desc&sp=$3&ep=$4 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-0-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/list.php\?catid=$2&sort=commissionNum_desc&sp=$3&ep=$4&page=$5 [I]

RewriteRule ^(.*)/yoyotaolb/([0-9]+)-([0-9]+).html$ $1/list.php\?catid=$2&sortnum=$3 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-.html$ $1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)--([0-9]+).html$ $1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5&page=$6 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)-([0-9]+).html$ $1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6&page=$7 [I]
RewriteRule ^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+).html$ $1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6 [I]

RewriteRule ^(.*)yoyotaodp/(.+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/shop.php\?user=$2&sortnum=$3&sp=$4&ep=$5&page=$6 [I]
RewriteRule ^(.*)yoyotaodp/(.+)-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/shop.php\?user=$2&sortnum=$3&sp=$4&ep=$5 [I]
RewriteRule ^(.*)yoyotaodp/(.+)-([0-9]+).html$ $1/shop.php\?user=$2&sortnum=$3 [I]
RewriteRule ^(.*)yoyotaodp/(.+).html$ $1/shop.php\?user=$2 [I]


求高手帮我看看,在GD空间应该怎么写伪静态文件!
谢谢!
还有请问下斑竹,GD的空间我放N个域名,支持一个域名一个伪静态吗?还是只能用一个伪静态文件?支持的话应该怎么写,求教,谢谢!

回答|共 13 个

wlxx

发表于 2010-10-22 21:04:24 | 显示全部楼层

我用 linux 的
在.htaccess里这样写
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule  #######################
</IfModule>

win的我没有用过

jsczy

发表于 2010-10-22 21:08:47 | 显示全部楼层

谢谢楼上,我是win主机的,放在httpd.ini就可以吧,但是我把在其他空间能用的放在根目录没有用~
RAKSmart

jsczy

发表于 2010-10-22 21:57:11 | 显示全部楼层

斑竹,出来帮帮忙啊!@@

fisher608

发表于 2010-10-22 22:53:43 | 显示全部楼层

不会呀

guduhun

发表于 2010-10-23 00:07:23 | 显示全部楼层

这个帮忙顶一下,版主来看看

tyucom 该用户已被删除

发表于 2010-10-23 00:27:52 | 显示全部楼层

我记得有人说过,GD的需要自己传个  就是添加一个web.config文件保存到网站所在的目录 这样的再在里面写规则,

具体你百度一下看

add.c

发表于 2010-10-23 10:06:30 | 显示全部楼层

是的,GoDaddy的Windows主机伪静态规则要写到web.config里

jsczy

发表于 2010-10-23 22:33:41 | 显示全部楼层

老大我不会写web.config那个规则,能帮我写一个吗?我已经把原来的httpd.ini的上传到这里了!
谢谢斑竹哦!帮帮忙,谢谢了!

jsczy

发表于 2010-10-24 00:15:01 | 显示全部楼层

我写了web.config结果上传到空间后网站就打不开了!
我写的代码如下,麻烦斑竹纠正下!
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer>


<rewrite> <rules>

<rule name="Imported Rule 17"> <match url=" ^(.*)yoyotaosp/([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/product.php\?iid=$2"

appendQueryString="false" /> </rule>


<rule name="Imported Rule 18"> <match url=" ^(.*)/yoyotaolb/([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php\?catid=$2"

appendQueryString="false" /> </rule>

<rule name="Imported Rule 19"> <match url="^(.*)/yoyotaolb/([0-9]+)-0.html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php\?catid=

$2&sort=commissionNum_desc" appendQueryString="false" /> </rule>


<rule name="Imported Rule 20"> <match url="^(.*)/yoyotaolb/([0-9]+)-0-([0-9]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php\?catid=

$2&sort=commissionNum_desc&sp=$3&ep=$4" appendQueryString="false" /> </rule>


<rule name="Imported Rule 21"> <match url="^(.*)/yoyotaolb/([0-9]+)-0-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php

\?catid=$2&sort=commissionNum_desc&sp=$3&ep=$4&page=$5" appendQueryString="false" /> </rule>

<rule name="Imported Rule 22"> <match url="^(.*)/yoyotaolb/([0-9]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php\?catid=$2&sortnum=$3"

appendQueryString="false" /> </rule>


<rule name="Imported Rule 23"> <match url="^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php\?

catid=$2&sortnum=$3&sp=$4&ep=$5" appendQueryString="false" /> </rule>




<rule name="Imported Rule 24"> <match url="^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-.html$" ignoreCase="false" /> <action type="Rewrite" url="$1/list.php\?

catid=$2&sortnum=$3&sp=$4&ep=$5" appendQueryString="false" /> </rule>


<rule name="Imported Rule 25"> <match url="^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)--([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite"

url="$1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5&page=$6" appendQueryString="false" /> </rule>



<rule name="Imported Rule 26"> <match url="^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite"

url="$1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6&page=$7" appendQueryString="false" /> </rule>


<rule name="Imported Rule 27"> <match url="^(.*)/yoyotaolb/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+).html$" ignoreCase="false" /> <action type="Rewrite"

url="$1/list.php\?catid=$2&sortnum=$3&sp=$4&ep=$5&q=$6" appendQueryString="false" /> </rule>



<rule name="Imported Rule 28"> <match url="^(.*)yoyotaodp/(.+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite"

url="$1/shop.php\?user=$2&sortnum=$3&sp=$4&ep=$5&page=$6" appendQueryString="false" /> </rule>


<rule name="Imported Rule 29"> <match url="^(.*)yoyotaodp/(.+)-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/shop.php\?user=

$2&sortnum=$3&sp=$4&ep=$5" appendQueryString="false" /> </rule>

<rule name="Imported Rule 30"> <match url="^(.*)yoyotaodp/(.+)-([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/shop.php\?user=$2&sortnum=$3"

appendQueryString="false" /> </rule>


<rule name="Imported Rule 31"> <match url="^(.*)yoyotaodp/(.+).html$" ignoreCase="false" /> <action type="Rewrite" url="$1/shop.php\?user=$2" appendQueryString="false"

/> </rule>




</rules> </rewrite> <httpErrors errorMode="Detailed" /> <asp scriptErrorSentToBrowser="true" /> </system.webServer> <system.web>   <customErrors mode="Off" />

<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />   </system.web>   </configuration>
您需要登录后才可以回帖 登录 | 注册

本版积分规则