[提问]
求助 win主机运行PHP 伪静态 .htaccess 转 web.config
|
|
win主机 谁能帮我啊,谢谢
htaccess
RewriteEngine On
RewriteBase /
# duoduo Rewrite规则
RewriteRule index\.html$ /index\.php
RewriteRule sitemap\.html$ /sitemap\.php
RewriteRule malllist\.html$ /malllist\.php
RewriteRule shoplist\.html$ /shoplist\.php
RewriteRule article\.html$ /article\.php
RewriteRule user/center\.html$ /user/center\.php
RewriteRule mall-(.*)\.html$ /mall\.php\?id=$1
RewriteRule view-(.*)-(.*)\.html$ /view\.php\?iid=$1&page=$2
RewriteRule view-(.*)\.html$ /view\.php\?iid=$1
RewriteRule malllist-(.*)-(.*)-(.*)\.html$ /malllist\.php\?catid=$1&mall=$2&page=$3
RewriteRule article_list-(.*)-(.*)\.html$ /article_list\.php\?cid=$1&page=$2
RewriteRule article_list-(.*)\.html$ /article_list\.php\?cid=$1
RewriteRule read-(.*)\.html$ /read\.php\?id=$1
RewriteRule list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /list\.php\?cid=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9
RewriteRule shop-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shop\.php\?nick=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9
RewriteRule shoplist-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shoplist\.php\?cid=$1&keyword=$2&startlevel=$3&endlevel=$4&area=$5&px=$6&page=$7
RewriteRule shoplist-(.*)\.html$ /shoplist\.php\?cid=$1
RewriteRule shop-(.*)\.html$ /shop\.php\?nick=$1
RewriteRule list-(.*)\.html$ /list\.php\?cid=$1
RewriteRule list\.html$ /list\.php
[ 本帖最后由 763639 于 2011-6-1 10:52 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
cryz
发表于 2011-6-1 22:54:36
|
显示全部楼层
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="index\.html$" ignoreCase="false" />
<action type="Rewrite" url="/index\.php" />
</rule>
<rule name="Imported Rule 2">
<match url="sitemap\.html$" ignoreCase="false" />
<action type="Rewrite" url="/sitemap\.php" />
</rule>
<rule name="Imported Rule 3">
<match url="malllist\.html$" ignoreCase="false" />
<action type="Rewrite" url="/malllist\.php" />
</rule>
<rule name="Imported Rule 4">
<match url="shoplist\.html$" ignoreCase="false" />
<action type="Rewrite" url="/shoplist\.php" />
</rule>
<rule name="Imported Rule 5">
<match url="article\.html$" ignoreCase="false" />
<action type="Rewrite" url="/article\.php" />
</rule>
<rule name="Imported Rule 6">
<match url="user/center\.html$" ignoreCase="false" />
<action type="Rewrite" url="/user/center\.php" />
</rule>
<rule name="Imported Rule 7">
<match url="mall-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/mall\.php\?id={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 8">
<match url="view-(.*)-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/view\.php\?iid={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 9">
<match url="view-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/view\.php\?iid={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 10">
<match url="malllist-(.*)-(.*)-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/malllist\.php\?catid={R:1}&mall={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 11">
<match url="article_list-(.*)-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/article_list\.php\?cid={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 12">
<match url="article_list-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/article_list\.php\?cid={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 13">
<match url="read-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/read\.php\?id={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 14">
<match url="list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/list\.php\?cid={R:1}&start_price={R:2}&end_price={R:3}&sort={R:4}&area={R:5}&guarantee={R:6}&list={R:7}&q={R:8}&page={R:9}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 15">
<match url="shop-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/shop\.php\?nick={R:1}&start_price={R:2}&end_price={R:3}&sort={R:4}&area={R:5}&guarantee={R:6}&list={R:7}&q={R:8}&page={R:9}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 16">
<match url="shoplist-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/shoplist\.php\?cid={R:1}&keyword={R:2}&startlevel={R:3}&endlevel={R:4}&area={R:5}&px={R:6}&page={R:7}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 17">
<match url="shoplist-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/shoplist\.php\?cid={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 18">
<match url="shop-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/shop\.php\?nick={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 19">
<match url="list-(.*)\.html$" ignoreCase="false" />
<action type="Rewrite" url="/list\.php\?cid={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 20">
<match url="list\.html$" ignoreCase="false" />
<action type="Rewrite" url="/list\.php" />
</rule>
</rules>
</rewrite> |
|
|
|
|
|
|
|
|
|
|
763639
发表于 2011-6-1 23:40:30
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
lwbo1987
发表于 2011-6-2 10:22:20
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
763639
发表于 2011-6-2 17:35:22
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
cryz
发表于 2011-6-2 17:38:35
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
763639
发表于 2011-6-2 17:43:46
|
显示全部楼层
程序商又提供了了我一个 HTTPD.INI
说要空间商加载
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# duoduo Rewrite规则
RewriteRule ^/index\.html$ /index\.php
RewriteRule ^/sitemap\.html$ /sitemap\.php
RewriteRule ^/malllist\.html$ /malllist\.php
RewriteRule ^/shoplist\.html$ /shoplist\.php
RewriteRule ^/article\.html$ /article\.php
RewriteRule ^/user/center\.html$ /user/center\.php
RewriteRule ^/mall-(.*)\.html$ /mall\.php\?id=$1
RewriteRule ^/view-(.*)-(.*)\.html$ /view\.php\?iid=$1&page=$2
RewriteRule ^/view-(.*)\.html$ /view\.php\?iid=$1
RewriteRule ^/malllist-(.*)-(.*)-(.*)\.html$ /malllist\.php\?catid=$1&mall=$2&page=$3
RewriteRule ^/article_list-(.*)-(.*)\.html$ /article_list\.php\?cid=$1&page=$2
RewriteRule ^/article_list-(.*)\.html$ /article_list\.php\?cid=$1
RewriteRule ^/read-(.*)\.html$ /read\.php\?id=$1
RewriteRule ^/list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /list\.php\?cid=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9
RewriteRule ^/shop-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shop\.php\?nick=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9
RewriteRule ^/shoplist-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shoplist\.php\?cid=$1&keyword=$2&startlevel=$3&endlevel=$4&area=$5&px=$6&page=$7
RewriteRule ^/shoplist-(.*)\.html$ /shoplist\.php\?cid=$1
RewriteRule ^/shop-(.*)\.html$ /shop\.php\?nick=$1
RewriteRule ^/list-(.*)\.html$ /list\.php\?cid=$1
RewriteRule ^/list\.html$ /list\.php |
|
|
|
|
|
|
|
|
|
|
cryz
发表于 2011-6-2 17:45:17
|
显示全部楼层
|
godaddy 不支持ISAPI_REWRITE,搜到的,仅供参考 |
|
|
|
|
|
|
|
|
|
|
763639
发表于 2011-6-2 17:45:31
|
显示全部楼层
|
源程序伪静态文件是放在空间子目录 /Rewrite/下 |
|
|
|
|
|
|
|
|
|
|
763639
发表于 2011-6-2 17:46:35
|
显示全部楼层
原帖由 cryz 于 2011-6-2 05:45 PM 发表 
godaddy 不支持ISAPI_REWRITE,搜到的,仅供参考
那这也行不通 |
|
|
|
|
|
|
|
|