Register   Login
     
  Latest Posts  
RE: how to add rating and comment in simple gallery
by mndmmnd on 10/07/2008 4:53 AM
RE: ENH: NA becomes the Article Manager and LA is the display module
by robax on 10/07/2008 3:48 AM
RE: RSS issue - running Win 2008 / SQL 2008
by robax on 10/07/2008 3:03 AM
RE: Editing Approved Articles
by glenwin on 10/07/2008 2:54 AM
RE: ENH - Multi FileUpload
by wknox on 10/07/2008 2:23 AM
RE: Archive Display Option
by smcculloch on 10/07/2008 1:50 AM
RE: Suggestion: Individual articles only viewable by select roles.
by smcculloch on 10/07/2008 1:49 AM
RE: Bad link when Display is set to Album
by smcculloch on 10/07/2008 1:47 AM
RE: Filter news list on user Role
by smcculloch on 10/07/2008 1:45 AM
RE: RSS issue - running Win 2008 / SQL 2008
by smcculloch on 10/07/2008 1:44 AM
  Forums  
Subject: BUG: Appending queries to end of friendly url
Prev Next
You are not authorized to post a reply.

Author Messages
Jason KoskimakiUser is Offline
Registered Users
Nuke Wiz
Nuke Wiz
Posts:194

7/24/2007 7:25 PM  

I have not tested this against a current version but it is obscure enough I will assume it has not been fixed and that it is in fact a problem.

In RewriterUtils.vb:

 

Change

context.RewritePath(sendToUrlLessQString,

To

context.RewritePath(sendToUrlLessQString,

As an example, if you have a url path such as mywebsite.com/forums/tid/2323/thread.aspx?pid=2 then Request.Url.ToString would have an extra ?. But with this fix, an extra ? is removed. I have had google have problems indexing pages where I add the ? to the end of a friendly url and think this may be the fix for it.

DISCLAIMER: I have customized this provider heavilly so I am not sure if this is an actual problem. But try it out and see.

NOTE: There are reasons to append ? at end of a friendly url instead of making it a parameter. For instance, I don't want google to think I have a bunch of duplicate content (with many different parameters within the url string as opposed to appended as a querystring) that still display the same content. Adding it to the end, google may recognize it as a query.

String.Empty, queryString.Replace("?", "&"))
String.Empty, queryString)
Friend Shared Sub RewriteUrl(ByVal context As HttpContext, ByVal sendToUrl As String, ByRef sendToUrlLessQString As String, ByRef filePath As String)

Social Networking Site for Young Professionals - My DNN Site w/ lots of Ventrian Modules
pbryanUser is Offline
Registered Users
Nuke Super Newbie
Nuke Super Newbie
Posts:12

7/25/2007 12:15 AM  
I haven't noticed this before. The version I have has code to check to see if there is a ? in the url. Are you using 4.3.4?
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:11937


7/25/2007 6:01 AM  
Previously, the urls like www.site.com/tabid/5/default.aspx?param=1 were translated correctly.

Your saying it puts 2 question marks, my question is, does it occur on the default provider or just your heavily modified one?

Scott McCulloch
Site Administrator
Jason KoskimakiUser is Offline
Registered Users
Nuke Wiz
Nuke Wiz
Posts:194

7/25/2007 3:07 PM  
OK. The test to try would be to goto a page with friendly urls and a query string appended and add a module which prints request.url.tostring and request.rawurl to the page. And see if it has double ? in it. They way I found this is somewhere I had some module which built URLs based on request.url and it got double ? which ended up causing problems. I have 360 webpage errors in my google webmaster account because of this. Note this should only cause problems in rare cases.

Also, I found that there was a minor issue with having a query string with spaces in it sometimes. In my case it causes problems but in other cases it may not. In my case when specifying mywebsite.com/child1/?test=valuewittnospaceinurl the url provider would detect I was in the main child portal and declare a match and return. But when doing mywebsite.com/child1/?test=valuewith%20spaceinurl it would not detect a match.

It took me hours to figure it out and I still don't understand it (maybe .net issue or else I am confused as heck). But what happens is url.replace(qs,"") does not find a match if the string has a %20 in it.

So doing:
url = myurl.aspx?q=myquery
qs=?q=myquery
url.replace(qs,"")
url will be myurl.aspx

But doing
url = myurl.aspx?q=myquery%20space
qs=?q=myquery%20space
url.replace(qs,"")
url will be myurl.aspx?q=myquery%20space

I don't know if this affects anyone either or if it is a true bug but thought I would post since I am really deep in the nitty gritty of this module and these would be hard to find bugs if they are so. I can post code later when I am on my dnn pc.

Jason

Social Networking Site for Young Professionals - My DNN Site w/ lots of Ventrian Modules
You are not authorized to post a reply.
Forums > Projects > Friendly Urls > BUG: Appending queries to end of friendly url



ActiveForums 3.7