关于多语言 URL 重写
我想实现 url 重写,例如,所有德语页面在域名后都有一个带有 /de/ 的 url(英语页面带有 /en/),但我实际上不必创建和管理所有这些子目录。我希望这个“de”/en 在整个网站上持续存在,
就像下面的文章中提到的那样:-
http://www.deevelop.com/en/web-design-company/blog/12/Multilingual-website.html
请检查“SUBDIRECTORIES”下的内容”这篇文章的标题。
本文不详细解释内容。我可以提供更多此类足够详尽的示例的链接吗?
或者如果有人实施了这样的事情可能会有所帮助。谢谢
I wanna implement url rewriting so that, for example, all german pages have a url with /de/ after the domain name (and english pages with an /en/) but I don't actually have to create and manage all those subdirectories. I want this "de"/en to persist through out the website
Just like mentioned in the article below:-
http://www.deevelop.com/en/web-design-company/blog/12/Multilingual-website.html
Please check the content under "SUBDIRECTORIES" heading in this article.
This article doesn't explain stuff in detail. Can I please have link to more such examples that are elaborative enough?
Or if someone has implemented such a thing may help. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
URL 重写是拦截传入的 Web 请求并将请求重定向到不同资源的过程。执行 URL 重写时,通常会检查所请求的 URL,并根据其值将请求重定向到不同的 URL。例如,在网站重组导致 /people/ 目录中的所有网页都移动到 /info/employees/ 目录的情况下,您可能需要使用 URL 重写来检查 Web 请求是否旨在用于/people/ 目录中的文件。如果请求是针对 /people/ 目录中的文件,您需要自动将请求重定向到同一文件,但位于 /info/employees/ 目录中。
您首先需要下载 SP1(免费)并安装它,然后点击以下链接:
http://msdn.microsoft.com/en-us/magazine/2009.01.extremeaspnet.aspx
http://chriscavanagh.wordpress.com/2008/03/11/aspnet-routing-goodbye-url-rewriting/
URL rewriting is the process of intercepting an incoming Web request and redirecting the request to a different resource. When performing URL rewriting, typically the URL being requested is checked and, based on its value, the request is redirected to a different URL. For example, in the case where a website restructuring caused all of the Web pages in the /people/ directory to be moved to a /info/employees/ directory, you would want to use URL rewriting to check if a Web request was intended for a file in the /people/ directory. If the request was for a file in the /people/ directory, you'd want to automatically redirect the request to the same file, but in the /info/employees/ directory instead.
You first need to download SP1(free) and install it, then follow these links:
http://msdn.microsoft.com/en-us/magazine/2009.01.extremeaspnet.aspx
http://chriscavanagh.wordpress.com/2008/03/11/aspnet-routing-goodbye-url-rewriting/