I recently read the MSDN article by Scott Mitchell regarding URL Rewriting, which is something very interesting for my site. (http://msdn.microsoft.com/asp.net/using/building/web/default.aspx?pull=/library/en-us/dnaspp/html/URLRewriting.asp) I've been trying
to implement it in my website (added references to URLRewriter.dll and ActionlessForm.dll) but it seems not to work... This is my web.config structure : [CODE] http://localhost/ArsLuminis/photography/(\d+)/(\d+)\.aspx http://localhost/ArsLuminis/photography/album/default.aspx?gid=$1&aid=$2
http://localhost/ArsLuminis/photography/(\d+)/(\d+)/(\d+)\.aspx http://localhost/ArsLuminis/photography/photo/default.aspx?gid=$1&aid=$2&pid=$3 [/CODE] I'm not good at this, I'm new to httpHandlers, so I'd be very grateful if someone could help me with this.
Does anyone have a clue wit what I'm doing wrong? Set some changes in IIS? Thanks in advance ! Niels
I haven't the slightest clue how Scott got his web.config changes to work. I've tried all sorts of permutations of what he did, and they all blew up my website. I eventually decided to get my configuration from a new XML file that I wrote instead, and I cache
the whole thing with the Cache object. Also, don't forget that you need {} around the variables //localhost/ArsLuminis/photography/album/default.aspx?gid=${1}&aid=${2} and you probably don't want the http://localhost in there, either. And don't forget to rewrite
the action attribute of the form tag (and this is where someone flames me and says 'but that's not valid HTML').
I won't flame you, but I'll ask because I'm having this problem right now, is that the preferred method when using Context.RewritePath ??? Because the Action is always wrong that path and not what the actual url request was. Just wondering if rewriting the
action tag on the form is the preferred method or if there's a better way
I rewrite the action tag of forms. It works, but never tell anyone that you did that because you'll get many people telling you that it's Teh Wrong Way. They get REALLY upset over it, for some reason.
hello sir, i read your article on URL rewriting in asp.net on msdn.i have also used the same in my project.URL rewriting is working fine in our LAN and on our configured IP but problem is that when we host our site to some ISP its not working and giving error
like this "THE PAGE CAN NOT BE FOUND" its really emberrasing because i am not able to find out the proble any where i am seding the code which i am using Sample code ================== Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' Fires at the beginning of each request Dim context As HttpContext context = HttpContext.Current() Dim strOldPath As String strOldPath = Trim(context.Request.Path.ToLower()) Dim strToken As String strToken = "accomodationdetail" Dim intI As Integer intI =
strOldPath.IndexOf(strToken) Dim intLen As Integer intLen = strToken.Length Dim intJ As Integer If intI <> -1 Then intJ = strOldPath.IndexOf(".aspx") If intJ <> -1 Then Dim strDetail As String strDetail = strOldPath.Substring(intI + intLen, intJ - (intI +
intLen)) Dim strNewPath As String strNewPath = strOldPath.Replace(strToken + strDetail + ".aspx", "AccomodationDetail.aspx?intID=" & strDetail) context.RewritePath(strNewPath) End If End If end sub ============================ but when i called some page like
this original request=/accomodation/accomodationdetail22.aspx after rewrite=/accomodation/accomodationdetail.aspx?id=22 above request is doing fine in our lan and on our configured IP but not working on ISP where we host our site and giving error "THE PAGE
CAN NOT BE FOUND" i think you got my problem please help me as soon as possible thanks regards sandeep MY MAIL id IS spandit@rsbsystems.com
None
0 Points
25 Posts
Help with URL Rewriting
Apr 10, 2004 04:10 AM|Apollo84|LINK
None
0 Points
181 Posts
Re: Help with URL Rewriting
Apr 12, 2004 01:51 PM|uber1024|LINK
Member
131 Points
94 Posts
Microsoft
Re: Help with URL Rewriting
Apr 25, 2004 07:57 PM|HumanCompiler|LINK
ASP.NET PM
http://about.me/erikporter
None
0 Points
181 Posts
Re: Help with URL Rewriting
Apr 26, 2004 10:21 AM|uber1024|LINK
Member
131 Points
94 Posts
Microsoft
Re: Help with URL Rewriting
Apr 26, 2004 10:23 AM|HumanCompiler|LINK
ASP.NET PM
http://about.me/erikporter
None
0 Points
1 Post
Re: Help with URL Rewriting
Apr 28, 2004 12:54 AM|pandit_26|LINK