Last post May 16, 2014 02:40 AM by Mikesdotnetting
May 14, 2014 12:02 PM|ssvikramuk|LINK
I have transferred all the files to the server but i would like to execute the file without extension(.cshtml). Any corrections to be made in the web.config file?
May 14, 2014 01:24 PM|CASPartan|LINK
No changes needed. It works out of the box just like that.
example: just link to it using /about instead of /about.cshtml
May 15, 2014 01:52 AM|ayanmesut|LINK
change the links to filename from fileanem.cshml and then publish again
May 15, 2014 11:07 AM|Chris17|LINK
Use Mike's method: http://www.mikesdotnetting.com/Article/165/WebMatrix-URLs-UrlData-and-Routing-for-SEO
May 15, 2014 11:39 AM|Rion Williams|LINK
You'll use a process called URL Rewriting to handle this, which involves creating the appropriate mappings so that your application / site knows that the ASPX portion of the address or page name is implied.
URL Rewriting Approaches for non-WebMatrix or non-WebPages
Scott Guthrie has an excellent tutorial and walkthrough on the topic that you might want to consider reading over :
The above post covers 4 different methods for handling rewriting URLs and I am sure that more than one of them are bound to suit your needs. If you need some additional resources on the topic or want to know a bit more about it (and what is going on),
I would recommend the following resources :
URL Rewriting Approaches for WebMatrix and WebPages
Mike Brind (known as mikesdotnetting here) is one of the go-to experts involving WebMatrix and he wrote a series of blog posts for handling this same topic (URL Rewriting) within WebMatrix / WebPages. I would recommend reading through his blog posts
listed below for a bit more information :
May 15, 2014 07:18 PM|CASPartan|LINK
This will work with any websites, not just ASP.NET, will even work with Classic ASP! I use this for Classic ASP sites, but it should also work for .aspx or .cshtml sites.
You can have this:
instead of http://www.domain.com/jobs.asp?ID=9281
Syntax is the same as Apache's mod_rewrite, so plenty of tutorials and example on the web... but this works for IIS.
Supports Rewrite Conditions, Redirects, Rewrites and multiple rules.
May 16, 2014 02:40 AM|Mikesdotnetting|LINK
he wrote a series of blog posts for handling this same topic (URL Rewriting) within WebMatrix / WebPages.
Neither article covers Url Rewriting. The first covers a routing paradigm built into the Web Pages framework, and the other covers a package for managing routing in Web Pages. Routing and Url Rewriting are very different approaches: http://www.iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing
Generally for ASP.NET apps, Routing is all you need for managing URLs.