Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Friendly URLs with query parameters get transformed to invalid URLs for some IDs

Vote:
 

Hi,

I am debugging a page that binds a list of RSS items to an ASP repeater. For each item a short article and a link is generated. Please see a slightly abbreviated version below.


	
		

<%# evalitem2.title.text>

<%# getpreviewtextevalitem2>

" returns numeric id strings title=""> <%# translate rsspage readmore>


For the first four RSS items, the following URLs, of which all but the second one are valid, are generated:

http://localhost:58281/url_subpath/?page_title_a&id=82
http://localhost:58281/contentassets/160edd27a99a466a8d3a435ea82ec057/?page_title_b
http://localhost:58281/url_subpath/?page_title_c&id=73
http://localhost:58281/url_subpath/?page_title_d&id=80

If I increase the numeric IDs by one (substituting Eval("Item1") with (int.Parse((string)Eval(Item1)) + 1).ToString())), I get the following URLs for the same RSS items:

http://localhost:58281/url_subpath/?page_title_a&id=83
http://localhost:58281/url_subpath/?page_title_b&id=82
http://localhost:58281/url_subpath/?page_title_c&id=74
http://localhost:58281/contentassets/160edd27a99a466a8d3a435ea82ec057/?page_title_d

Without the ID part, the remaining parts of the URLs are generated correctly:

http://localhost:58281/url_subpath/?page_title_a&id=
http://localhost:58281/url_subpath/?page_title_b&id=
http://localhost:58281/url_subpath/?page_title_c&id=
http://localhost:58281/url_subpath/?page_title_d&id=

(I have generalized and simplified the URLs for clarity.)

Some observations:

  • ID=81 seems to cause EPiServer to transform the URL. (Although there are more cases not listed here.)
  • The transformation is not done by any of the functions called in the code above
  • I have also tried having the URL-generating code in codebehind. Proper URLs are generated there.
  • The URLs containing contentassets are invalid.
  • The URLs that should have been generated are valid.

I would like to know why this is done, at what phase, and how it can be avoided. Any help would be much appreciated.

Thanks and best regards,

Hampus

#115842
Jan 20, 2015 11:21
Vote:
 

Solved

A solution was to rename the query string parameter. In this case item_id was used instead of id.

#115864
Jan 20, 2015 15:15
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.