URL Redirection with BlogEngine

I am now moving the blog from dasBlog to BlogEngine. In dasBlog, my urls look like this.

http://pfsolutions-mi.com/blog/2008/03/08/Beyond-Compare.aspx

While on BlogEngine, my URLs are as follows.

http://pfsolutions-mi.com/blog/post/2008/03/08/Beyond-Compare.aspx

The only difference between the two URLs is the "post" subfolder on BlogEngine.

Since I am currently using the RISRITE URL to remove the WWW from the URL, I decided that the easiest solution would be to create another rule to handle adding the subfolder. I tried something like this.

rule name = "Blog redirection" enabled = "true" stopProcessing = "true"

match url = "^ blog / ([_ 0-9] +) / ([_ 0-9] +) / ([_ 0-9] +) / ([_ 0-9a-z -] +). ([_0-9a-g -] +) $ "

action type = "Redirect" url = "blog / post / {R: 1} / {R: 2} / {R: 3} / {R: 4}. {R: 5}" redirectType = "Temporary"

However, when I enter the old dasBlog URL, it does not redirect to a new location. Instead, I get a generic BlogEngine 404 error page.

Note. I plan to change redirectType to permanent as soon as I know that everything works.

+3
source share
1 answer

Shouldn't your corresponding regular expression look like this?

match url="^blog/([0-9]+)/([0-9]+)/([0-9]+)/([\w-]+)\.([a-z]+)$"

There are no underscores in numeric numbers anyway, and yours [_0-9a-z-]+does not contain any capital letters, as in Beyond-Compare.

, : url = "^ //// .lowercase-letters $"

:

match url="^blog/([0-9]{2,4})/([0-9]{2})/([0-9]{2})/([\w-]+)\.([a-z]{3,4})$"

, :

  • "08" "2008"
  • "01" "11"
  • 3 4 (htm, html, php, asp, aspx ..)

EDIT: , "\ w +" , "[\ w -] +"

+1

All Articles