Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

ISAPI Rewrite to URL Rewrite conversion

$
0
0

Hi, I have a bunch of sites that use the ISAPI Rewrite module on a shared hosting server. For a bunch of reasons, I need to change host - and the new host will not support ISAPI Rewrite, so I need to try URL Rewrite.

I tried to test converting one of my rules over locally using the 'Import Rules' option - it spat me out some new code which I added to my web.config file, and it failed.

At the moment, ISAPI Rewrite will rewrite a page URL something like:

http://www.website.com/pages/newsdetail.asp?articleID=6

into something like:

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

ISAPI reads a text mapfile that is generated dynamically each time a new article is entered into the CMS. The mapfile is formatted something like:

article-name-first 1
article-name-second 2
article-name-third 3
article-name-fourth 4
article-name-fifth 5
article-name-sixth 6

My ISAPI rule located in the .htaccess file looks like this:

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

and works fine.

So ISAPI will look in the mapfile (mapfileNews.txt), get the querystring value and use the text description as the URL.

Is this something that URL Rewrite can do also?

I am hopeless at this stuff. Unfortunately the guy who did my ISAPI stuff is no longer available.

I'd be willing to pay someone to do this :)


Viewing all articles
Browse latest Browse all 2482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>