Issue With Always Rendering The Default Angular Route For A List Of Client Side Routes

- 1 answer

Just want to say I really like, but I am currently having an issue with it and I am wondering if maybe I am doing something wrong and people with more experience with the service can help me out.

I am having the same issue with the site and also with a Debian Linux box I setup with prerender for local execution.

My new site is a hybrid of ASP.Net MVC and angular, where angular represents workflows (or categories of content) within MVC routes on the server.

An example of a category of content is this:



The MVC server side route is:


and #!/news and #!/welcome are the angular app routes and welcome is also the default route.

When I send my URL to the service or my local instance:[somesitename]/PublicContent/#!/news

The prerender service is only ever rendering:


and is ignoring the client side route after the #!

so for all my pages for each MVC route I am merely getting the default route rendered multiple times...

Is this a bug with Or do I not have something not properly configurered?

I do have the:

<meta name="fragment" content="!">

in the head for all my pages if that would matter.



Talked with the guys over at, and it appears that a modification I made to the Asp.Net MVC middleware where it was removing ?_escpaed_fragment_=/ completely was an incorrect modification to this code, which itself was incorrect (the base code removed ?_escpaed_fragment_=/ and replaced it with nothing, I modified the code to remove ?_escpaed_fragment_=/ and replace it with #!).

The service expected ?_escpaed_fragment_=/ to exist in the URL and if it finds it it will replace it with #! before calling your website to cache the page. It doesn't expect to find the #!, so it won't properly process the URL if it is there.

So if you are using the Asp.Net MVC middleware you should comment out the following code from PrerenderModule.cs:

        // Remove the _escaped_fragment_ from the URL if it exists!
        var escapedFull = "?" + _Escaped_Fragment + "=/";
        if (url.Contains(escapedFull))
            url = url.Replace(escapedFull, string.Empty);