如何将Zen Cart的.htaccess改为win主机下的php伪静态?

用于收藏精华贴子、网友共享的资料等。可以回复,不能发新贴。

版主: daimadaquan

版面规则
本版面不能发新贴,可以回复

如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子mxzjl » 2010-04-07 19:59

以下是Zen Cart的.htaccess,我用的是godaddy的win主机,IIS 7,网上介绍用web.config可以实现php伪静态,该怎么改啊?
Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]
mxzjl
初来乍到
初来乍到
 
帖子: 2
注册: 2010-02-21 17:24
QQ 帐号: 5316581

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子Jack » 2010-04-07 22:45

为什么不用linux的主机,能省去很多麻烦
头像
Jack
论坛版主
论坛版主
 
帖子: 11665
注册: 2004-12-16 10:04

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子mxzjl » 2010-04-09 22:13

主机下已有多个网站,改linux麻烦更多啊
mxzjl
初来乍到
初来乍到
 
帖子: 2
注册: 2010-02-21 17:24
QQ 帐号: 5316581

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子kenlong » 2010-04-13 12:12

如何将Zen Cart的.htaccess改为win主机下的php伪静态?有尝求教?QQ:563360369
kenlong
初来乍到
初来乍到
 
帖子: 1
注册: 2010-04-13 12:00
QQ 帐号: 563360369

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子liberydn » 2010-04-22 14:51

我会修改,跟我联系。
liberydn
初来乍到
初来乍到
 
帖子: 2
注册: 2010-04-22 14:49
QQ 帐号: 65113257

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子forever9981 » 2010-04-29 0:27

我改成这样了,还是有些问题,请jack和各位高手解答!
代码: 全选
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
     <rewrite>
      <rules>
     <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^print_page_p(.*)$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=print_page&amp;products_id={R:1}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 2" stopProcessing="true">
      <match url="^(.*)_p(.*).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=product_info&amp;products_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 3" stopProcessing="true">
      <match url="^(.*)_c([0-9]+)$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=index&amp;cPath={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 4" stopProcessing="true">
      <match url="^(.*)_c([0-9]+)/([-\w]*)$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=index&amp;cPath={R:2}&amp;display={R:3}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 5" stopProcessing="true">
      <match url="^(.*)_c([0-9]+)/([-\w]*)/([-\w]*).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=index&amp;cPath={R:2}&amp;display={R:3}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 6" stopProcessing="true">
      <match url="^(.*)-m-([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=index&amp;manufacturers_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 7" stopProcessing="true">
      <match url="^(.*)-pi-([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=popup_image&amp;pID={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 8" stopProcessing="true">
      <match url="^(.*)-pr-([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=product_reviews&amp;products_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 9" stopProcessing="true">
      <match url="^(.*)-pri-([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=product_reviews_info&amp;products_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 10" stopProcessing="true">
      <match url="^producttags/([-\w]+)/$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=producttags&amp;letter={R:1}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 11" stopProcessing="true">
      <match url="^producttags/([\w])/([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=producttags&amp;letter={R:1}&amp;page={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 12" stopProcessing="true">
      <match url="^wishlist/$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=wishlist" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 13" stopProcessing="true">
      <match url="^wishlist/([\w])/$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=wishlist&amp;letter={R:1}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 14" stopProcessing="true">
      <match url="^wishlist/([\w])/([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=wishlist&amp;letter={R:1}&amp;page={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <!--# For Open Operations Info Manager-->
    <rule name="Imported Rule 15" stopProcessing="true">
      <match url="^(.*)-i-([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=info_manager&amp;pages_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <!--# For dreamscape's News & Articles Manager-->
    <rule name="Imported Rule 16" stopProcessing="true">
      <match url="^news/?$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 17" stopProcessing="true">
      <match url="^news/rss.xml$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news_rss&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 18" stopProcessing="true">
      <match url="^news/archive/?$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news_archive&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 19" stopProcessing="true">
      <match url="^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news&amp;date={R:1}-{R:2}-{R:3}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 20" stopProcessing="true">
      <match url="^news/archive/([0-9]{4})-([0-9]{2}).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news_archive&amp;date={R:1}-{R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 21" stopProcessing="true">
      <match url="^news/(.*)-a-([0-9]+)-comments.html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news_comments&amp;article_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 22" stopProcessing="true">
      <match url="^news/(.*)-a-([0-9]+).html$" ignoreCase="false" />
      <action type="Rewrite" url="index\.php?main_page=news_article&amp;article_id={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
    <rule name="Imported Rule 23" stopProcessing="true">
      <match url="^(.*).html$" ignoreCase="false" />
      <conditions>
        <!--# All other pages-->
        <!--# Don't rewrite real files or directories-->
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index\.php?main_page={R:1}&amp;{QUERY_STRING}" appendQueryString="false" />
    </rule>
  </rules>
</rewrite>
   <httpErrors>
               <remove statusCode="404" subStatusCode="-1" />
               <error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />
           </httpErrors>
</system.webServer>
<system.web>
<customErrors mode="Off" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
</system.web>
</configuration>
forever9981
初来乍到
初来乍到
 
帖子: 2
注册: 2010-04-29 0:24
QQ 帐号: 44091850

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子forever9981 » 2010-04-29 9:56

特别感谢liberydn,已经帮我解决了。
forever9981
初来乍到
初来乍到
 
帖子: 2
注册: 2010-04-29 0:24
QQ 帐号: 44091850

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子dumin145 » 2010-07-15 16:24

同样感谢 liberydn 朋友
也帮我解决了这个问题
dumin145
初来乍到
初来乍到
 
帖子: 3
注册: 2009-11-01 22:37

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子liberydn » 2010-08-16 9:26

鉴于很多人找我解决问题,我把我修改的文件直接上传上来,供大家参考。
注意:需要把文件中的“yourdomain”修改为实际域名
web.rar
需要把文件中的“yourdomain”修改为实际域名
(1008 Bytes) 被下载 312 次
liberydn
初来乍到
初来乍到
 
帖子: 2
注册: 2010-04-22 14:49
QQ 帐号: 65113257

Re: 如何将Zen Cart的.htaccess改为win主机下的php伪静态?

帖子goodgoodstudy » 2010-12-06 3:33

请问这个文件放在什么位置呢?是每个文件夹里面都要放吗?我有好多网站,每一个都要一个一个文件夹放进去吗?有成功了的朋友帮忙指点下吗
goodgoodstudy
初来乍到
初来乍到
 
帖子: 1
注册: 2010-12-06 3:28
QQ 帐号: 1456174765

下一页

回到 精华共享

在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客