Can prerender.io help for situations like dynamic seo for a front end route with dynamic parameters? - ruby-on-rails

The detailed problem can be found on this link - https://stackoverflow.com/questions/36931309/dynamic-seo-for-routes-in-angular2any-frontend-routing-framework?noredirect=1#comment61422672_36931309
My situation is - I have a front end route /category/:categoryId. This categoryId could be different and accordingly I fetch different data from server. This data contains the title that I should set for this page.
Now doing SEO for different categoryId in this case seems impossible from frontend as google bot won't wait for my server response while crawling.
Can prerender solve this particular situation and how? I have never used prerender.io. My backend is written in ruby on rails.

Yep! Prerender loads your pages in a browser just like a user would and then saves the resulting HTML to serve back to the crawlers. That way you can dynamically load content, or even dynamically tell us to return a 301/404 to the crawlers based on the content.

Related

PWA - Cache and load same appshell for different seo-friendly urls

We are consumer internet and have SEO friendly urls: www.xyz.com/user-1, www.xyz.com/user-2, www.xyz.com/user-n. Technically these are all user pages with different url's. And we need to load only one html file (app-shell) for all these cases.
What I want to achieve is that:
Go to www.xyz.com/user-1 page, cache the html (app-shell) file.
Navigate to www.xyz.com/user-2 page, get the html response from cache of www.xyz.com/user-1 ( since it is the same app-shell ).
I couldn't achieve this because, the 'match' method of cache api works on url request object, and I couldn't manipulate it. Is there a way where I can manipulate the url request object? Or is there a workaround for it?
You can create your own response if you want. However I think you are describing the classic SPA architecture. There you would have an app shell and fill in the main content area on the client-side, either by rendering the markup in the browser or appending pre-rendered markup from the server.
You might want to check out the sw templating strategy as a possible place to start -> https://jakearchibald.com/2014/offline-cookbook/#serviceworker-side-templating

S3 Static Website Nice URLs

We are working on a website with a static frontend, API Gateway + Lambda as the backend, DynamoDB as the DB. I saw there were a couple similar questions to this one, but I'm looking to understand the matter throughly to build a complete and robust solutions, since I hope to build several websites using this stack.
This one is a fairly basic website: we have an index.html page, a blog.html page and a portfolio.html page. We also have an html page for single portfolio entries (let's call it portfolio-entry.html) and a page for single blog articles (let's call it blog-post.html).
So I see there's a way to specify an index page and an error page, so you can have a nice clean url for your index. There are also rewrite rules, which are more like redirects.
I guess my best bet to deliver different blog posts would be to pass a query string to blog-post.html ("mywebsite.com/blog-post.html?post=post-alias") and have the .js ask the API different content depending on the query string.
Is there a way using S3 to route mywebsite.com/blog/post-alias/ to mywebsite.com/blog-post.html?post=post-alias and pass the response to the client without redirecting? I'm both interested in "client-side url rewriting" via JS to have nice URLs for humans AND server-side routing to catch crawler requests and have SEO/indexing of pages for specific posts, for example.
How should I go about this? Is there a way to achieve all this using what S3 and JS provide or do I have to put a proxy/router (like nginx) in front of S3 to handle route requests?
We are really committed to the whole S3-ApiGateway-Lambda-Dynamo architecture and we would really love to do without server.

Umbraco - different behaviour for usual and ajax requests

I'm developing an Umbraco site that is a "single page" - no reload, only ajax calls.
The site will have nice urls and use html5 push state history.
The problem here is that every time a request is made to the server I need to handle it differently depending on the type of the request: normal or ajax.
For usual requests I need to display the content along with it's master page.
For ajax requests I need to display only the content.
I don't know how to accomplish this - routing and master page magic.
Can anyone help?
You could use alternate templates. For more information see here. Basically, have the alternate template just render out the content in whatever format you want, without the full html template, and then make sure that all your AJAX requests call the pages using the alternate template.
One word of warning though, if you're doing all the site navigation with AJAX and no page reloads, then Google (or most other search engine spiders for that matter) won't be able to index your site properly (as they don't process javascript) and your site won't rank very well.

Hide website filenames in URL

I would like to hide the webpage name in the url and only display either the domain name or parts of it.
For example:
I have a website called "MyWebSite". The url is: localhost:8080/mywebsite/welcome.xhtml. I would like to display only the "localhost:8080/mywebsite/".
However if the page is at, for example, localhost:8080/mywebsite/restricted/restricted.xhtml then I would like to display localhost:8080/mywebsite/restricted/.
I believe this can be done in the web.xml file.
I believe that you want URL rewriting. Check out this link: http://en.wikipedia.org/wiki/Rewrite_engine - there are many approaches to URL rewriting, you need to decide what is appropriate for you. Some of the approaches do make use of the web.config file.
You can do this in several ways. The one I see most is to have a "front door" called a rewrite engine that parses the URL dynamically to internally redirect the request, without exposing details about how that might happen as you would see if you used simple query strings, etc. This allows the URL you specify to be digested into a request for a master page with specific content, instead of just looking up a physical page at that location to serve.
The StackExchange sites do this so that you can link to a question in a semi-permanent fashion (and thus can use search engines with crawlers that log these URLs) without them having to have a real page in the file system for every question that's ever been asked (we're up to 9,387,788 questions as of this one).

Is there a way to find all the pages' link by a URL?

If I have a link say http://yahoo.com/ so can I get the links inside yahoo? For example, I have a website http://umair.com/ and I know there are just 5 pages Home, About, Portfolio, FAQ, Contact so can I get links as follows programmatically?
http://umair.com/index.html
http://umair.com/about.html
http://umair.com/portfolio.html
http://umair.com/faq.html
http://umair.com/contact.html
Define what you mean by "links inside yahoo".
Do you mean all pages for which there is a link to on the page returned by "http://www.yahoo.com"? If so, you could read the HTML returned by an HTTP GET request, and parse through it looking for <a> elements. You could use the "HTML Agility Pack" for help.
If you mean, "All pages on the server at that domain", probably not. Most websites define a default page which you get when you don't explicitly request one. (for example, requesting http://umair.com almost certainly returns http://umair.com/index.html). Very few website don't define a default, and they will return a list of files.
If you mean, "All pages on the server at that domain, even if they define a default page", no that cannot be done. It would be an extreme breach of security.
This could be done by a Web Crawler, read some basic information about it:
http://en.wikipedia.org/wiki/Web_crawler
Includes Open Source crawlers, see if any of them is what you are looking for.

Resources