By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

URL rewriting and web.config

P: 7
I am using for my project. In my my project 2 pages are using URL rewriting method by referring this article

URL Rewriting using Intelligencia UrlRewriter Example 1 - Blog Day Afternoon

from my form i used this code.
Response.Redirect("showdetails/" + a);

in my Web.config
Expand|Select|Wrap|Line Numbers
  1. <system.webServer>
  2.     <modules runAllManagedModulesForAllRequests="true">
  3.       <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule"/>
  4.     </modules>
  5.     <validation validateIntegratedModeConfiguration="false"/>
  6.   </system.webServer>
  7.   <rewriter>
  8.    <rewrite url="~/showdetails/(.+)" to="~/details.aspx?id=$1" permanent="true"/>
  9. </rewriter>
these are the code i used.
this code rewrite my url like this

But i wantto remove that "showdetails" part from url and.
create a valid url like this
if i copy paste this link into address bar it must work.
If i remove that string, then other pages(Normal pages ending with extension
like index.aspx) they got error.

can i check extension in web.config.? Or is there is any other way for url rewriting?

Please help me...
Dec 29 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,731
Have you tried adding rewrite entries for the regular pages as well?
Since you are removing the "showdetails" from the URL, the server still needs to be able to map to the files in the "showdetails" directory...which means you have to map to the files that you want to use.
Dec 30 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.