I'm designing an ASP.NET MVC Application in which I've constructed multiple Action methods for a single view with [ActionName("Name-Of-Action")] attribute with each methods.
**E.g ViewName= Contact.aspx
controller Action methods like :
[ActionName("Contact-us")]
Public ActionResult Contact_us()
{return view("Contact");}
.
.
[ActionName("contact-now")]
Public ActionResult Contact_Now()
{return view("Contact");}
.
.**
and so on...
I wish to make this site SEO Friendly, Can you please mention the pros and cons of calling a single webpage with different ActionMethods(URLs) in terms of SEO Scenario.
Thanks in Advance..
As with #naveen as specified, you could be penlised for duplicate content. If you really need to have different URLs for your content, you would need to use a canonical link tag so search engines know that the content is the same as the other page, and is not considered duplicate.
<link rel="canonical" href="http://www.mydomain.com/contact.aspx" />
This is quite prevalent in shopping cart systems, whereby you could have a product in multiple categories, but you make all of the content essentially canonical to a single URL, e.g.
1. http://www.mydomain.com/products/jellyfish.aspx
2. http://www.mydomain.com/products/sealife/jellyfish.aspx <-- canonically the same as #1
This will definitely affect you rankings adverslye if we sre talking not only about contact page. Your site will be penalized for duplicate content.
A good approach will be to fix one as ur desired url and Response.RedirectPermanent on the others. Stack Overflow deals with this issue like this.
Test for yourself by playing with our current url by deleting the slug or altering it. You will see 301(permanently redirected) issued in the console to the actual url.
Hope this helps.
Related
I have a problem to make a decision for putting Category/Path on URL Routing. Assume I have some products in my sample Web Application those attached to some categories. For example:
Book1 Attached to -> Category1 | Category2
Book2 Attached to -> Category1 | Category2 | Category3
Book3 Attached to -> Category2 | Category3
And defined routing map for products is:
url: "{controller}/{action}/{languageCode}/{category}/{product}"
defaults: new { controller = "Home", action = "ViewItem" }
So possible routing for Book1 are:
[Domain Name]/Home/ViewItem/en-US/Category1/Book1
[Domain Name]/Home/ViewItem/en-US/Category2/Book1
And possible routing for Book2 are:
[Domain Name]/Home/ViewItem/en-US/Category1/Book2
[Domain Name]/Home/ViewItem/en-US/Category2/Book2
[Domain Name]/Home/ViewItem/en-US/Category3/Book2
I want to save and know current category but have single unique URL for each product(For search engine tracking and sharing URLs purpose). I think about using Session Variable or ViewBag even Cookie, But each of them has own limitations and cons. For example using cookies may cause some troubles: if set expiration time too small, it may lost current path when user pausing on some pages and if set it too long, may lead user to old browsing path even user requested for home page in new opening browser because of existing cookie (Except that, I'v some experiences with cookies and I believe that is not working precisely all times), About Session and ViewBag I don't know if using them is the best idea, So can anyone share tested solution or good idea? I will appreciate that.
You should have the page mywebsite.com/product1 (the canonical version of the URL). Including all the versions of the URL won't help. Likely, it will just confuse Google and may lead to Google ignoring certain URLs
Even if you put in the canonical version and have the rel canonical tag on your pages, Google may still choose to treat another version of the URL as canonical.
Ideally, then, I'd solve the real problem here and just have one version of the product URL on your site (have the versions with the category in the URL redirect to the version of the URL with no category in the URL). That way you don't even have to worry about all the issues duplicate content may cause.
I suspect this isn’t a routing problem, rather an architectural issue. I think that the “language code” and “category” should be an attribute of the Book object, rather than being a part of the route.
You would then have URLs like:
{domain}/{controller}/book/id
And for “category” specific or “language code” specific views, you could have URLs like:
{domain}/{controller}/search?languageCode=enUS&category=1
This would still be perfectly RESTful and in my opinion, much simpler as well.
I'm working on a new advert website and want to implement some good SEO URLs.
I got category URLs like:
/category
/category/sub-category
This seems ok. What about detail pages?
Option 1:
/announcements-and-notices/announcements-various/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
Option 2:
/adverts/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
In reality my website has a pretty long URLs due to multiple areas you can shop. So it would become:
/en/area-name/announcements-and-notices/announcements-various/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
/en/area-name/adverts/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
Which detail page would be a better URL? The first option seems to be better if the product has no long/good title. The second seems better as its the most relevant one and shortest especially with long category names.
I would like to hear your thoughts!
EDIT:
I found this two google docs:
http://www.google.nl/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDYQFjAA&url=http%3A%2F%2Fwww.google.com%2Fwebmasters%2Fdocs%2Fsearch-engine-optimization-starter-guide.pdf&ei=lXyaT6T_L8zR4QSM4c2qDw&usg=AFQjCNEMj8KHxhxQz9cMLoMxMDiLdrAbJw
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=76329
I think I will be going for /adverts. Anyone disagree?
i have seen many of SEO analysts miss something about optimizing their webpage and that is your page will be optimized for only some keywords not all keywords. it is not important how length is your URL. you should first analyze whether the contents in your webpage is rich enough to have such URL with these keywords or not. if the answer for every keyword is yes then the more length will give you the more rank.
I think you can even set your pages up in a way to use only the slug and skip the id, such as:
/adverts/suscipit-dis-molestie-malesuada-vestibulum-ut
or even just:
/suscipit-dis-molestie-malesuada-vestibulum-ut
like this and refer straight to the adverts controller and the advert itself, which has this slug assigned to it (the one with id 15880).
This way you'll have nice and clean URLs. Just assign and keep an unique slug for each advert and handle it using .htaccess, or dynamically inside the code of your site, if the system allows it.
Cheers.
I seek some guidedence here ... ( I'm not sure if this is the best title )
At the moment I prepend a "server name" to the url like this:
server10.example.com
This works fine, except that I need to handle all the subdomains on the IIS and I'm not sure google are happy about jumping around from sub to sub to sub, when it seems the links to the other servers.
I'm kind a hoping for a nice way to archive this wioth asp.net mvc.
Most pages are related to a "server" ... there are however a few info pages, contact, home that dont really need a valid "server" name ... but could just be "na" for not available, but the name need to be maintained, if there is already a selected server, when a user are keeps browsing the site. This needs to be as transparent as possible when I need to create the links to the diffenrent pages.
I could extend the Html Action() extensien to automatically add the selected "server" from the previusly request to the page.
In the format:
/{serverParameter}/{controller}/{action}/{parameterInfo}
And if no server is selected, just add "na" as the {server} placeholder.
I'm not sure if more information is needed, but please let me know if ...
I tired of extracting the selected server from the domain part and the other way also seems better, I just can't think of a good way to structure this ...
Updated
90% of all the pages are about a server that the user select at some point. Could be server10, server9, server20 ... just a name. I want to maintain that information across all pages, after the users has selected it or else I just want it to be f.ex: "empty".
I mostly looking for an easy way of doing this or an alternative ... atm I'm prepending the serverParamter to the url so it ends up being: "serverParameter.example.com".
I want to end up with something like
http://example.com/{server}/{controller}/{action}
instread of
http://{server}.example.com/{controller}/{action}
If I understand your question correctly, you just wish to group different collections of content together above the controller/action level. If that's the case, have you considered using ASP.NET MVC areas?
Just right-click on your project, and choose Add -> Area.... Give it a name (what you're calling "server"), and then you can add content, your own controllers, actions, etc. Under this area. You will automatically be able to access it via /AreaName/Controller/Action/etc.
I went with the already impemented routing in ASP.NET MVC.
{server}/{controller}/{action}
When creating the links it takes the set value for {server} and places the value when generating URL's, so I only need to supply controller and action in the #Html.Action helper method ... this could not have been more easy.
I'm not sure why I did not think about this. One just gotta love routing.
I am using ColdFusion 9.0.1.
I have a new web site that uses Bikes.cfm and Makers.cfm as template pages. I need to be able to pass BikeID and MakerID to both of the these pages, along with other variables. I don't want to use the Actual page name in the URL, such as this:
MyDomain.com/Bikes.cfm?BikeID=1234&MakerID=1234
I want my URL to look more like this:
MyDomain.com/?BikeID=1234&MakerID=1234
I need to NOT specify the page name in the URL.
I want these two URLs to access different data:
MyDomain.com/?BikeID=1234&MakerID=1234 // goes to bike page
MyDomain.com/?MakerID=1234&BikeID=1234 // goes to maker page
So, if BikeID appears in the URL before MakerID, go to the Bikes.cfm page. If MakerID appears before BikeID, go the Makers.cfm page.
Is there an easy and existing method to arrange the URL keys in such a way to have them point to the appropriate page?
Should I just parse the the URL as a list and determine the first ID and go to the appropriate page? Is there a better way?
Any thoughts or hints or ideas would be appreciated.
UPDATE -- It certainly appears that using the order of parameters in a URL is a bad idea for the following reasons:
1) many programs append variables to the URL
2) some programs may reorder the variables
3) GoogleBot may not consider order relevant and will most likely not index the site correctly.
Thanks to everyone who provided advice in a positive manner that my approach was probably a bad idea and would not produce the results I wanted. Thanks to everyone who suggested alternate means to produce the results I wanted.
If anyone of you positive people would like to put your positive comment/advice as an answer, I'd be happy to accept it as the answer.
Despite my grave misgivings about the whole idea, here's how I would do it if I were forced to do so:
index.cfm:
<cfswitch expression="#ListFirst(cgi.query_string, '=')#">
<cfcase value="BikeID">
<cfinclude template="Bikes.cfm">
</cfcase>
<cfcase value="MakerID">
<cfinclude template="Makers.cfm">
</cfcase>
<cfdefaultcase>
<cfinclude template="Welcome.cfm">
</cfdefaultcase>
</cfswitch>
Today I heard from my colleague that search bot can index pages with sequential ids.
Is it really happens ?
As an example checkout two urls:
http://sample.com/myProduct?id=765
and
http://sample.com/myProduct?id=35d6eb6c-97f6-4cde-997c-ade657c285d3
So, if search bots can figure out that my product id in url is sequential it can possibly index other products up and down the sequence ...
Have you ever heard anything like that ?
Whomever told you that is mistaken. Search engines will only index pages they know exist. So they won't keep changing the ID in those URLs just see if they find anything. So if you want those other pages to be indexed you should use a HTML sitemap or XML sitemap to tell the search engines where those pages are. Linking to them from other product pages is also a good idea.