Forums / All Other Contributions/Addons / help url rewrite in the IIS7.0?

help url rewrite in the IIS7.0?

Locked

Started by jjyypi on 30 Jun 2010, 6:37 AM · Views: 2,914

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
30 Jun 2010, 6:37 AM
#1
jjyypi avatar

jjyypi

New Zenner

Join Date:
Jun 2010
Posts:
10
Plugin Contributions:
0

help url rewrite in the IIS7.0?

Bad luck my host is IIS7 ,so can't using .htaccess,
the Hosting providers told i have to use the web.config to rewrite urls,
this the host's web.config test Rule:

<system.webServer> 
<rewrite> 
<rules> 
<rule name="rule1" stopProcessing="true"> 
<match url="^article/([0-9]+)/([_0-9a-z-]+)" /> 
<action type="Rewrite" url="article.aspx?id={R:1}&title={R:2}" /> 
</rule> 
<rule name="rule2" stopProcessing="true"> 
<match url="^tags/([0-9]+)" /> 
<action type="Rewrite" url="tags.php?tags={R:1}" /> 
</rule> 
<rule name="rule3" stopProcessing="true"> 
<match url="test.html" /> 
<action type="Rewrite" url="test.asp" /> 
</rule> 
</rules> 
</rewrite> 
</system.webServer> 

this my store's web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Digimartz Rule 1" stopProcessing="true">
<match url="^print_page_p(.*)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=print_page&products_id={R:1}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 2" stopProcessing="true">
<match url="^(.*)-p-(.*).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=product_info&products_id={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 3" stopProcessing="true">
<match url="^(.*)-c-(.*).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=index&cPath={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 4" stopProcessing="true">
<match url="^(.*)_c([0-9]+)/([-\w]*)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=index&cPath={R:2}&display={R:3}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 5" stopProcessing="true">
<match url="^(.*)_c([0-9]+)/([-\w]*)/([-\w]*).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=index&cPath={R:2}&display={R:3}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 6" stopProcessing="true">
<match url="^(.*)-m-([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=index&manufacturers_id={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 7" stopProcessing="true">
<match url="^(.*)-pi-([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=popup_image&pID={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 8" stopProcessing="true">
<match url="^(.*)-pr-([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=product_reviews&products_id={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 9" stopProcessing="true">
<match url="^(.*)-pri-([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=product_reviews_info&products_id={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 10" stopProcessing="true">
<match url="^producttags/([-\w]+)/$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=producttags&letter={R:1}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 11" stopProcessing="true">
<match url="^producttags/([\w])/([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=producttags&letter={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 12" stopProcessing="true">
<match url="^wishlist/$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=wishlist" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 13" stopProcessing="true">
<match url="^wishlist/([\w])/$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=wishlist&letter={R:1}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 14" stopProcessing="true">
<match url="^wishlist/([\w])/([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=wishlist&letter={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<!--# For Open Operations Info Manager-->
<rule name="Digimartz Rule 15" stopProcessing="true">
<match url="^(.*)-i-([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=info_manager&pages_id={R:2}" appendQueryString="false" />
</rule>
<!--# For dreamscape's News & Articles Manager-->
<rule name="Digimartz Rule 16" stopProcessing="true">
<match url="^news/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=news" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 17" stopProcessing="true">
<match url="^news/rss.xml$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=news_rss" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 18" stopProcessing="true">
<match url="^news/archive/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=news_archive" appendQueryString="false" />
</rule>
<rule name="Digimartz 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&date={R:1}-{R:2}-{R:3}" appendQueryString="false" />
</rule>
<rule name="Digimartz 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&date={R:1}-{R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 21" stopProcessing="true">
<match url="^news/(.*)-a-([0-9]+)-comments.html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=news_comments&article_id={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 22" stopProcessing="true">
<match url="^news/(.*)-a-([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=news_article&article_id={R:2}" appendQueryString="false" />
</rule>
<rule name="Digimartz Rule 25" stopProcessing="true">
<match url="^(.*)_c([0-9]+)/([-\w]*)/([-\w]*).html$" ignoreCase="false" />
<action type="Rewrite" url="index.php?main_page=index&cPath={R:2}&sort=20a&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Digimartz 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}" 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>

the most urls can Static, but it have a problem, when i hit the next page the also show the page1.i know one Rule is wrong , but i don't know how to write ,somebody can help me ?
my store :www.digimartz.net

the error url:http://www.digimartz.net/index.php?main_page=index&cPath=10&sort=20a&page=2

take a look ,help me please!!

30 Jun 2010, 9:39 AM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: help url rewrite in the IIS7.0?

You do not need to do URL rewriting anymore.

The search engines PREFER that dynamic urls are maintained.

20 years a Zencart User

7 Jul 2010, 3:15 AM
#3
jjyypi avatar

jjyypi

New Zenner

Join Date:
Jun 2010
Posts:
10
Plugin Contributions:
0

Re: help url rewrite in the IIS7.0?

thanks!
but why do not we try to solve it ?:smile:

7 Jul 2010, 10:15 AM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: help url rewrite in the IIS7.0?

jjyypi:

thanks!
but why do not we try to solve it ?:smile:

Why try to "fix" something that isn't needed?

20 years a Zencart User