I want to use routing to create a multi-cultured web site.
I was thinking of re-writing the URLs for each language.
Contact Us Page - Example:
English:
http://www.domain.com/ContactUs
French:
http://www.domain.com/NousContacter
Instead of the traditional way of:
English:
http://www.domainname.com/en/contact
French:
http://www.domainname.com/fr/contact
Is this possible to do this without breaking search engines like Google and Yahoo?
I think these samples will help. Seems the first link is more close what I trying to tell.
Hope it helps.
http://geekswithblogs.net/shaunxu/archive/2010/05/06/localization-in-asp.net-mvc-ndash-3-days-investigation-1-day.aspx
http://msdn.microsoft.com/en-us/library/dd381609.aspx
https://gist.github.com/1583539
Related
A very long title, sorry for that.
I'm looking for your input on the best way to support localization in an ASP.NET MVC 5 project in which i would like to pass the locale as part of the querystring. This way it would be easy for users to share a link to website and also pass the correct locale as part of the link.
If this would be done using, for example cookies, the user would pass a link but the page might be in a different language for the person who receives the link. I don't think that that is very nice.
The solution i currently use (http://afana.me/post/aspnet-mvc-internationalization.aspx) does not work nice with incorrect urls and just keeps loading the same page in loop. There is a lot of information on the web and i already went through a lot but i would like to know what is most commonly used and really works well.
As a bonus i would like the solution to work with attribute routing as my current solution doens't play nice :(
you can use resource files for that, the current culture is in the current thread of the web request, so no need to pass it in the querystring but it can be done;
have a look at this live demo: http://prodinner.aspnetawesome.com
you can download/read pdf about it here: http://prodinner.codeplex.com
you can see there that you can change the language using the dropdown;
in Global.asax.cs Application_BeginRequest, there's already code in there related to language, it reads a cookie now (or it's absence), you can make it read the querystring
Ok. I hope it's a right question and title.
I'm totally newbie to asp.net and c#. I've been searching the answer for days and got nothing. So i think this is the best place to ask this question.
this is my current URL
http://localhost:7474/mywebsite/ProductDetails.aspx?Category=CSR&artID=36&alias=support-for-central-jaya-and-yogyakarta-earthquake-disaster
I Want to make search engine friendly url. Can I make above URL to
http://localhost:7474/mywebsite/ProductDetails/CSR/36-support-for-central-jaya-and-yogyakarta-earthquake-disaster
FYI I'm not using MVC.
Yes, you can.
Take a look at RouteCollection.MapPageRoute for details but roughly you need the code below:
routes.MapPageRoute(
"ProductDetails",
"/ProductDetails/{Category}/{artID}/{alias}",
"~/ProductDetails.aspx");
However artId and alias cannot be in the same segment. They need to be separated by a slash (/).
The other difference is that you need to grab the parameter values from RouteData instead of querystring so instead of:
Request.QueryString["Category"]
you do:
Page.RouteData.Values["Category"]
ps: I did it from the top of my mind so it might not compile
May be you can try URL Rewriting. That would be an ideal choice to implement this with no code change at all. And use regular expression to extract values from the url to bounce the values to original aspx page.
http://www.iis.net/downloads/microsoft/url-rewrite
Yes, we can create search engine friendly URL using ASP.NET routing feature. This blog post have an example of URL routing -
http://newapputil.blogspot.in/2013/12/aspnet-40-web-forms-url-routing.html
I want to translate my ASP.NET website, just like microsoft does.
I want the urls to have /en-EN/ or /de-DE/
the problem is that my urls ar already routed URLs
How can I do this?
I found this http://blog.maartenballiauw.be/post/2010/01/26/Translating-routes-(ASPNET-MVC-and-Webforms).aspx
but I don't want to translate all the urls and this method seems to me too complex, with Views and Controllers.
I need mysite.com/en-EN/routedpage or mysite.com/de-DE/routedpage
The above example is for mvc, is your website in mvc?. You need to setup your website for culture specific setting, here is an article how to do that
http://www.ezzylearning.com/tutorial.aspx?tid=3477182
Also for further reading
http://www.codeproject.com/Articles/7998/Creating-multilingual-websites-Part-1
and
http://www.codeproject.com/Articles/8073/Create-multilingual-web-pages-very-easily
its very easy to setup
This is an important problem. You want the URL to have the language encoded in it for both SEO and usability purposes.
Two common solutions are:
1) Change the domain. fr.example.com or de.example.com. Then the routes don't need to be changed.
2) Use the # for the language code. Search engines nowadays will observe this. So, then you'd have www.example.com/#de or www.example.com/#fr
You can implement both of these solutions with www.SiteTran.com by simply pasting our javascript into your page and setting the sitetran_url_type variable to either:
var sitetran_url_type = 'sub.domain';
or
var sitetran_url_type = 'hash';
SiteTran is 100% free and is my company.
I have a pretty slick website and I wanted to add a simple blog system to it, without too much work. I've looked into a few blog systems, but none of them seem to be simple almost control like systems.
So anyone have any recommendations for a simple asp.net blog engine?
There's usually not much to a blog. A table to hold the entries, a page to make entries, and a page that lists them out.
If you want people to leave comments, then again it's not that hard. A table to hold the comments and a section on your blog viewing page to add a comment. I would use some form of a captcha entry, their name, and the actual comment itself; no need to "register" to be a user.
All in all, probably a good couple hours work; which would be less than implementing someone elses stuff. Just be sure to sanitize the comments to prevent xss attacks.
The ASP.Net site contains a section for community open source projects and starter kits. One of the open source sections is blogs:
http://www.asp.net/community/projects
Subtext is simple to setup, but if you want to integrate blogging into your site you can try BlogEngine. You can find links to both of them in the link above.
I have a very dynamic / ajax powered website which also includes iframes and due this reason I have a very bad SEO rank and it come in my mind to make one more additional version of the site (text based / no script) and serve it to the search engines based on the user agent . Please let me know if you think that is a feasible method and if it's not what else would you recommend me to do .. I don't want to loose any fancy ajax feature but I also need to keep the website on the google map :)
thank you in advance for any answer !
btw the website is developed in asp.net c# .
Why not just refactor the site properly in the first place, instead of maintaining multiple copies? It's more effort up front, but will be less effort in the long-run.