Last post Jul 16, 2017 11:52 PM by kmcnet
Jul 16, 2017 04:50 PM|kmcnet|LINK
Hello everyone and thanks for the help in advance. I am new to MVC and am deploying a test application in order to understand how MVC works. When I browse to the
www.mysite.com, the controller for HomeController/Index fires as expected rendering the default home page. However, I see that to browse to the About page, the url required is www.mysite.com/home/about.
I assume this is typical behavior, but it begs the question of how would you create paths to pages such as
www.mysite.com/about. Also, since MVC creates paths to directories rather than pages, does this affect SEO? Any insight would be appreciated.
Jul 16, 2017 05:19 PM|ryanbesko|LINK
If you would like your about page to be mysite.com/about, create a controller called AboutController. Then right-click in the default Index method in that controller and select Add View. It will make a view called Index in a folder called About in the
If you open your HomeController, you can now delete the code for the About method. You can do the same above steps for the Contact method. The default project template is just a starting point. It keeps it simple and gives you an idea of how MVC routing
Jul 16, 2017 11:52 PM|kmcnet|LINK
Thanks so much. I should have thought of that. Does pointing to a directory affect SEO rankings as opposed to pointing to an actual page?