Try our conversational search powered by Generative AI!

Url Rewriter for pagination


I am having a technical difficulty implementing pagination for a blog which is rewriting the url.  I can actually get it to rewrite the url as such:
"/Views/Pages/Blog?pageIndex=2" -> "/Blog/2"  but when i actually click on teh link, I am getting the nasty 404 error.  Is there something i am missing?  I am using EPiServer 7 Webforms.  Could someone guid me in the right direction?

Nov 17, 2013 7:09

Are you sure the URLs and requests are the same? (both are GET requests, there´s no ending / in the URL etc).


Nov 17, 2013 18:16

I am not sure Frederik.  When i hover over the links, i get the right url, but when i click on it, i get the 404.  So i assume the url rewrite is working.   I am not as familiar with url rewriting as most people are, I will be the first to admit.  I never really had to use it. 

Nov 17, 2013 19:30

The easiest would be to use a proxy tool like Fiddler to check both requests and inspect them. There has to be a difference between them,


Nov 17, 2013 20:38

Hey Frederik, I know you're a busy man, do you have a sample of a friendly url rewriter.  All i am really trying to accomplish is is to remove the &pageIndex=2 to respect /xxxx/2  and have episerver recognize that there is a querystring of pageIndex.  If not, I totally understand.  I have been trying everything.  I have charles proxy running but as soon as I click "/blog/2"  it instantly redirects to 404 page.  The header show 404.  I apologize for my ignorance on the urlrewriter.

Nov 17, 2013 20:47

There's been a similar thread in the past that does almost the same thing you need:

And the code:

You can simplify it more since you only need the paging and not the product.


Edited, Nov 17, 2013 20:59

Thanks man.  It is much appreaciate.  I have looked all over and found most of the rewriting articles are for 6r2 or 6 which i know they are handled differently now.  Thanks again frederik.

Nov 17, 2013 21:02

I think i spoke too soon.  Question, i know routes in global are used for mvc but does webforms hook into that in episerver for paths, or do i have to extend the friendly rewrite provider.  The cross over is a bit of a blurred line for me

Nov 20, 2013 17:12

Regarding CMS 7 and frindly URL rewriter, this is a good article to read!

Nov 20, 2013 17:43

I think i have it working 90%.  I have the url rewriting working and the routes working but wondering why i cannot see the values in the request.querystring params.  I am offically confused.  my url is as follows
my route is as follows

                    name: "BlogPageAndCategory",
                    url: "/{node}/page/{pageIndex}/category/{category}",
                    defaults: new
                        pageIndex = UrlParameter.Optional,
                        category = UrlParameter.Optional


Placeholder (Default)Actual
pageIndex ("") --
category ("") --
Parameter NameConstraintIs Match
action Castle.Proxies.IRouteConstraintProxy --
Nov 20, 2013 21:17

above is from glimpse showing both my params are blank

Nov 20, 2013 21:18
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.