开发者

How to rewrite /archive/* to /post/* in ASP.NET

I'm trying to migrate from SubText to BlogEngine.NET and I want to keep the links to the old posts working. The URLs are very similar, previously they were:

http://server/arch开发者_StackOverflow中文版ive/year/month/day/name-of-the-post.aspx

and now they are

http://server/post/year/month/day/name-of-the-post.aspx

I'm using IIS 7.5 with ASP.NET 4.0 in Integrated Mode. What's the best way to rewrite the "/archive/" to "/post/", knowing that I now also have a http://server/archive.aspx that has to keep working?

Best Regards,

Gustavo Guerra


Best thing to do is use the extension:

SEO Redirection

http://www.blogenginewall.com/post/2011/04/01/BlogEngine-SEO-Permanent-Redirection-From-Old-URL-To-New-URL.aspx

Real easy to use and this is what I use.

All you do is put:

Old URl: http://server/archive/year/month/day/name-of-the-post.aspx

New URL: http://server/post/year/month/day/name-of-the-post.aspx

Thats it!

Not only does it redirect but will also return a 301 Status to the search engines telling them that the old URL is no longer being used and to use the new instead url.

This way it also updates the search engines.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜