angular-seo icon indicating copy to clipboard operation
angular-seo copied to clipboard

Doesnt seem to route properly when html5mode is activated

Open HadrienPierart opened this issue 10 years ago • 1 comments

I can see this code in the server.js file :

var route = parse_qs(request.url)._escaped_fragment_;
var url = urlPrefix
  + request.url.slice(1, request.url.indexOf('?'))
  + '#!' + decodeURIComponent(route);
renderHtml(url, function(html) {
    response.statusCode = 200;
    response.write(html);
    response.close();
});

Clearly, this creates a route prefixed with '#!' which breaks my router which is configured for urls like localhost:8080/signup and not localhost:8080#!/signup.

This results in having only the / url supported and properly indexed. Any other url will simply render / content... I tried to remove '#!' from your source code in the server to test it, and it works fine now.

This needs to be compatible with html5mode now.

Great work though, it served me a lot on multiple projects, thanks !

HadrienPierart avatar Sep 13 '15 12:09 HadrienPierart

Removing the #! fixed the problem for me, cheers!

jvgeee avatar Oct 10 '16 16:10 jvgeee