I want to rewrite: http://www.domain.com/Apple-Mobile-Phones/AppleiPhone516GBBlackMobilePhone.asp Code (markup): to http://www.domain/apple/appleiphone516gbblack-deals.asp Code (markup): How to do that in IIS 7? Thanks in advance.
Get the microsoft rewrite module mate http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module
In my server, its already installed. My question is how can i do that. I know that i have to change web.config but what's the code to do that....Anybody ?????
You'd need to use the below code in web.config <!--web.config url rewrite--> <system.webServer> <rewrite> <rules> <rule name="RedirectToWWW" stopProcessing="true"> <match url=".*" ignoreCase="true" /> <conditions> <add input="{HTTP_HOST}" pattern="^domain.com$" /> </conditions> <action type="Redirect" url="[URL]http://www.domain.com/{R:0}[/URL]" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> Code (markup): Well this is just an example code, you'd need to customize it according to your requirements.
Thanks for your reply but I need that customized code. I already specified my requirements in this thread, so please help me accordingly.
As I understand you want to replace "Apple-Mobile-Phones" with "apple" and this is easy. (I use Intelligencia.UrlRewriter.RewriterHttpModule) <rewriter> <rewrite url="~/apple/(.*)" to="~/Apple-Mobile-Phones/"/> </rewriter> But the second part I couldn't see a logical expression. AppleiPhone516GBBlackMobilePhone -> appleiphone516gbblack-deals Hope it helps...
Thanks for your reply. But i am using URL Rewrite Module 2.0 and it has some different format as Markwebuk mentioned. The second thing you mentioned that "I couldn't see a logical expression" . I think we can catch last MobilePhone.asp through some logical expression and convert it into -deals.asp