Hello,
To optimize google ranking i want to use the item description and category in the URL
I thing this is possible with webconnection with a URL like
www.mywebsite.com/myproductcategory/myproductdescription/showitem.wwt
showitem VFP method could analyse the calling URL to locate the item ..
But my question is how did Amazon handle such URL without file extension
https://www.amazon.com/books-used-books-textbooks/b/ref=topnav_storetab_b?ie=UTF8&node=283155
Is It possible to handle this type of request with IIS and Webconnection ?
Thank you
Does this answer your questions? https://west-wind.com/webconnection/docs/_3k812udq3.htm
Yes looks like, tank you Tore !
You're welcome.
To use URLs like you are suggesting should work without the requirements for extensionless URLs and without URL Rewriting. But you will still need to figure out some custom URL parsing in order to figure out what values to retrieve from the URL to determine products and categories.
Script maps work all the way down the configured Web root path so regardless of where the URL lives in the 'directory' hiearachy, ShowItem.wwt
will fire the ShowItem
method in your applicable process class. You can use wwRequest::GetRoutingInfo()
to retrieve the route segments.
+++ Rick ---
Thank you Rick !
Some old Html documents have a good ranking so I ask me also the best way to trigger Web Connection with HTML extension I suppose I have to use the IIS UrlRewrite Module ?
If all html documents in your app are going through Web Connection then you can just add a script map for HTML and handle it in Web Connection. That's probably the easiest. But that only works if every html page in that virtual/site goes through WWWC.
Otherwise yes, you need to URL Rewrite or create a .NET based rewrite handler to figure out exactly what to route where.
+++ Rick ---
Thank you Rick !
Another of my current question is about a double extension like
showitem.amp.wwt ( showitem.amp method is not possible in VFP)
So what would be the best way to rewrite the url before processing by the RouteRequest() ?
First off I think double extensions are a bad idea. But if you use any kind of extension, you shouldn't need any rewrite rules because Web Connection will pick up the last extension.
The URL parsing beyond that your code can handle.
+++ Rick ---
I found a sample for the Accelerated Mobile Pages Project – AMP in the Google tutorial samples with this double extension. ( Article.amp.html versus article.html (for HTML) ).
As the logic beyond showitem is the same ( for HTML and AMP ) it could be nice to handle the request with same method and just set a process property to indicate we have to handle another layout .. . Not tested but it seems AMP is not compatible with standard boostrap ( we have to handle it with a 'light' version ) This could be with done with alternate path, but I was curious ..