MVC Routing Structure and SEO friendly URLs - asp.net

I have a MVC project that has a number of views in the Views/Home folder to which are currently accessed as /Home/About, /Home/Contact, etc... but these are summary pages with multiple content sections on each page.
I need to link to an View/Home/Content.cshtml page to show the linked summary page in its entirety.
I'd link to replace /Home/About with /About and say the linked page as /About/Overview as opposed to /Home/Account/Content/1 is this possible?
If so could somebody please explain how I need to format ActionLink's accordingly and anything else I need to configure in the project.
Any help would be much appreciated :-)

Related

Redirecting to .aspx in a different domain

Okay, I'm dealing with a problem hear.
I'm building landing pages for my company.
The main website works with a .aspx form to retrieve car data (from for example licenseplates).
Now we've set up some new relevant domain names to use for some of the landing pages.
The problem now is, that when on those pages I type in licenseplate and click search, it fails doing so.
Since it tries to find the .aspx form on the landing page domain url.
For example:
Main site: www.mysite.com/category.aspx?k=80zbfk (refered to when the licenseplate is typed in.)
Landing page: www.mysite2.com/category.aspx?k=80zbfk (were it refers to on the landing page)
No the second one should refer to the first one. But I can't seem to find a way to do so.
I don't have acces to the .aspx files since they're in control of a external company.
Is there any way to fix this? To refer the landing page to the .aspx from the main site?
Or do I have to contact the webcompany to ask for the files so I can copy them to the other domain?
Thanks in advance!
It sounds like you want to be using absolute links rather than relative.
An absolute link includes the host and path of the target url, whereas a relative one contains only the path and lets the browser infer the host (via the url being visited).
For example, if you were editing the HTML of a page here on Stack Overflow, the absolute link to this question would look something like this,
http://stackoverflow.com/questions/26379795/redirecting-to-aspx-in-a-different-domain
While the relative one would look like this,
/questions/26379795/redirecting-to-aspx-in-a-different-domain
In the case of the latter one, the browser would be left to assume based on context that you wanted to go to that path on http://stackoverflow.com/. There's a bit more to it, and variations on that syntax exist. But that's the gist of it.
So, getting back to your question, yes. You will probably have to update the ASPX pages. Relative links are best practice in most cases, which explains why they were used in your code, but you've got an exception. It's probably going to be easiest to just go through and change whatever links you need, to point to the main domain. But for what it's worth, that should be a relatively easy fix, once you get the files.
Alternatively, you could set up a rewrite rule or redirection policy on your landing page servers to automatically 301 redirect any requests that contain search information off to the main server, but that's definitely a workaround approach, and there will be a performance hit in doing so. The one and only advantage that I can imagine to doing that is that you wouldn't need to get the pages from the third party, but it sounds like that wouldn't be a bad idea to do anyway.

Flex 3: Project Architecture & SEO

I've got a Flex 3 project. One of the problems I have is that not very much of its content is indexed by Google. Currently, I pull data from a mySQl database, so the Googlebot doesn't see most of the site.
My goal is to increase the amount of content indexed by Google, improve the SEO, and improve SERPs.
I thought that instead of pulling the data from the database that I would change the project's architecture and create separate "pages". So, in my case, I would compile each puzzle separately and upload it to the server in its own directory. This way the info in each puzzle would get indexed.
The negative is that if I add a puzzle, I'd have to add a link to it in all of the puzzles that are already on the server. I would have to add the link, re-compile each puzzle and upload it to the server. Is there a way to get around this problem? Also, if I wanted to communicate some data from one puzzle to another in the future, I wouldn't be able to do so.
Any suggestions?
Thank you.
-Laxmidi
The usual way to achieve this goal is to develop a hidden parallel site in HTML.
On the first page you will have your flash and, hidden by javascript, a list of links to the other pages. These links will be parsed by the robots. Ideally, the href pages are virtual (look for "url rewriting"). On each "fake" page, your server-side language will print on the page a content or links from your database AND the flash. The flash will be provided with a string explaining where it is and what it's supposed to show.
Ex: http://www.mysite.com/category1/content7 The URL rewriting sends this request to http://www.mysite.com/index.php?uri=category1/content7. The page should display the Flash with FlashVar "uri=category1/content7". The Flash knows which content it has to display so when an user comes from google, following this link, he will find the content he was looking for.
Every linking and content for SEO should be in HTML, don't trust robots capability of reading Flash.
have a look at Adobe's reference on deep-linking.
you can generate a website's sitemap.xml with a cron process (daily), such that the URLs encode the state of the application you need. This URL will encode whatever content you need to retrieve from the db, with just one index.html page.
good luck!

ASP.NET master page vs. SharePoint page layout template

A client of mine uses SharePoint to manage its websites, and recently asked me to build a small website for them using ASP.NET, which they would then implement via SharePoint.
My skills with ASP.NET are intermediate, and I have no experience at all with SharePoint.
I created a master page for the site, as well as the individual pages, but the client is telling me that they also need a page layout template in order to view and manage the site via SharePoint.
Unfortunately I have no idea what this means. So, my questions are:
What is the difference between a master page and a page template?
What does this page template look like? In other words, what type of file is it, and what kind of code goes in it?
Thanks in advance for any help you can provide!
The masterpage is what defines the design of your site. It applies for all pages within that site, except for the application pages which are shared by all SharePoint sites in the farm and use a different master page. You can recognize the application pages by looking at the url... it contains /_layouts/ (a virtual directory shared by all SharePoint sites).
When you create a new page in a MOSS site that has the publishing feature enabled, you are asked to specify a page layout. For example: 'Article page with image on right'. Each page layout is bound to one content type, in this example the content type 'Article'. Each content type can have multiple page layouts bound to it. You can have an article with the image on the right, with the image on the left or even without an image.
The content type is what defines the metadata for the page. An article for example, has a title, description, page image, article date,...
The page layouts are stored in the Master Page Gallery. You can create page layouts for existing content types, or you can create a new content type.
Basically, the master page defines how your site looks like, the page layouts define how your pages look like. One way (the easiest way) to create page layouts is to use SharePoint Designer which you can download for free from the Microsoft download pages.
You can find a lot of information about creating page layouts on the web. This may be a good starting point: http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-publishing-page-layout-HA010174128.aspx

how to get search engines to understand a DB driven asp.net site

All,
This would seem like a fairly basic asp.net question - but in all my years of coding, I've never really thought about it.
Say you have a asp.net 2.0 site with only a masterpage and a default.aspx and its a blog that saves all the data into the database. Links on the side are generated automatically. So ... the URL is always just http://www.XXXXX.com/default.aspx.
So, with that being the case, what do you need to do so that ... say google ... knows about all the different blog entries and links directly to the entries instead of just the base URL?
Is it as simple as changing the forms method to: method="get"?
Thanks, L. Lee Saunders
There are at least two solutions:
Search engines understand query strings, so just add the article IDs to the URLs in your anchor tags -- no need to even use a form control.
Use URL rewriting to expose one set of URLs to the outside world (like /article-title/1234/) in your anchor tags, and then modify the URL to be default.aspx when it arrives at your site; the page could then pull the article to be displayed from any number of places, including but not limited to a query string.
You could have a REST webservice so that you can just use urls to navigate the site, and perhaps have a front page with some new posts, so that the spider can navigate the site..
As an example, look at the urls for SO, it is easy for a spider to navigate this database-driven website.
Create a page that just serves up XML Sitemap (the data obviously being pulled from your database) and submit the sitemap to Google.
Google will then index any links in your sitemap.
(This assumes that these is some difference between each article - e.g. a Querystring key/value).
Useful Link(s):
Web Sitemap Generators
Google Sitemap Validator
Google Sitemaps for ASP.NET 2.0 (there are about a gazillion interesting links off the back of this as well).
some sort of URL rewriting may be an answer
I wouldn't recommend a postback for your situation, it can get ugly for refreshes etc. So, yes, change the method to "get"
Then, say your page of, default.aspx?postid=12345 will get translated into /mm/dd/yy/this-is-my-post.aspx

Making a static ASP.NET site which has 100+ pages

I am converting an old html based website to ASP.NET, so that we can include more features like AJAX, Databases later on to the site. Currently my task is to create a new .aspx page for each older html page. To keep the layout persistent i have made a master page.
So currently i am building a content page from the master page, then renaming the content page and adding the text from the html page to the content placeholder area. However i was wondering if can cannot write a system, which can act as a Page Thrower.
Each hyperlink when clicked goes to a serverside code, where it requests the page it wants to load. Typically a webserver expects that the pagelink specified in the hyperlink does exist physically, but here what i am trying to do is that. Say the link is for the page "TravelDetails", the page need not exist physically, but the content of it is present in a file in (html format). so the Page Thrower gathers the data to display for that page, it has a master page already, it adds the html of it there and then throws the custom page. This way i don't have to keep 100+ aspx pages, i can do with a single page and maintain another data structure to store the content (static data) for each page. any guidance if my approach is right, and how to go about it?
Thanks
I think you should try some cms avaialable in market like dotnetnuke. Because every time you need to have to create a web page for a html page. In future if there will be any changes then it will take time. While in cms like dotnetnuke you just need to paste your html in existing system. You don't need to do coding again.
DotNetNuke is a free one. There are other Content Management System also available as well. Another advantage is that dotnetnuke is having skin features. So if you change skin at one place. You need not to do it for all the places.
Take a look at ASP.NET MVC. It uses ASP.NET Routing, which may help you.
Alternatively you can use ASP.NET Routing without MVC, too.
Matthias
Just a thought.
Create a page linked to the Master Page. In the content place holder add a Panel.
Let your Page thrower decide which page to display, retrieve the html data & add it to the panel at runtime.
Why don't you create the pages dynamically and then use asp.net caching in order to increase throughput.

Resources