Closed jazeee closed 9 years ago
@dr-dimitru This should help address the 404 issue: https://github.com/jazeee/jazeee-meteor-spiderable/commit/3cd05c38afb6aa25da1e9d64242efd8dc1a370a2
Let me know what you think.
@jazeee Okay, you did exactly what I've missing all this day. I'll add part of your code into main What I currently did:
/not-found
notFoundTemplate
render if ___isRunningPhantomJS___
redirect to that real 404It will take around 1-2 days to test and done everything. What do you think?
I made some minor corrections to clean up the server code. In particular, I am now storing the responseCode, instead of error, in the cache.
I believe we've solved this issue at last release
Currently, all pages return with status code of 200, even if the route does not exist.
Returning 404 for non-existent pages is important for SEO.
This is a bit tricky in Meteor. Meteor and IronRouter don't really allow you to easily return 404's.
Even though IronRouter says it defaults to 404's, it doesn't seem to do that. Instead it renders a default template. I can't figure out how to make it 404. There are a number of discussions online...
What I was able to do is to specify a default route using
And for the pageNotFound template, I can add:
Then, I can use that in phantomJS. I have that working, which was a bit of a pain dealing with PhantomJS specifics...