1

I have an existing site that uses ISAPI Rewrite by way of the .htaccess file. I am moving to a new host also on a Windows server and have been told that my rules must be loaded to the web.config file.

So the old rules looked like this:

RewriteBase /
RewriteMap mapfileNews txt:mapfile/mapfileNews.txt
RewriteCond %{QUERY_STRING} ^ArticleID=[^&]+&n=(.+)
RewriteRule ^pages/ndetail\.asp$ news/%1? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^news/([^/]+)$ pages/ndetail.asp?
ArticleID=${mapfileNews:$1}&n=$1 [NC,L]

So what the rule is doing is opening the mapfileNews.txt file, grabbing the ID number and mapping it to an article name. Like:

http://www.website.com/pages/ndetail.asp?ArticleID=7

being rewritten to something like

http://www.website.com/news/article-name

I have no idea how to convert this over so it works in my web.config file.

And please excuse me for my noobness. I'm not tecchy at all :(

R. Apps
  • 17
  • 4

0 Answers0