Reputation: 18797
Sometimes when I search some phrases in Google (e.g "My Custom Search Phrase"), I see some very interesting results. Sites that look like:
http://www.example.Com/My_Custom_Search_Phrase/
or:
http://www.example.Com/My_Custom_Search_Phrase.html
Actually, I don't like these sites. I know it's a SEO trick and pages are generated on the fly and are full of ads. But I'm very curious to know how this can be achieved programmatically. Preferably in .Net.
P.S. By saying "Preferably in .Net" I don't mean I want the code in .Net, But some guides about how it can work using .Net technology.
Upvotes: 1
Views: 665
Reputation: 62127
Depends what .NET you use.
Classic ASP.NET: you can use them as custom error page (file not found, hammer out your own results).
MVC: a route to a view / controller that accesses the path to see the search phrase, then gets their results and generates the page.
The result can be terrific. If you have a good internal site search system this can drive HUGE amounts of traffic. I did a shop once where the search on the customer discussion drive about 70% of the traffic to the pages. Making sense of them is another story (i.e. the result page must be efficient in getting people to go to the products). This is not even unfair - the discussion results were very accurate. Capture rates were VERY good (i.e. people not leaving the site) after optimizing the look to make sure people knew where to go.
Upvotes: 1
Reputation: 55142
Well, most web servers have a facility to create "Wildcard" mappings.
That is, they'll take pages that don't exist on your server, and hand that off to the relevant language processor (say, aspnet_isapi.dll
in .NETs case).
So, if you write code in the place that gets handed this request for a wildcard (i.e., physically non-existent file), you can pretend that you have it.
This is how URL Re-writing works. Typically you invent some URL scheme, like /article/some-content/identifier
, and then you use the identifier to look up the article, while leaving components in the URL such that search engines can "see" that it is "relevant".
Upvotes: 1