Hey.
I'm trying to write a quick-and-dirty ISAPI filter for IIS URL rewriting, to simulate the Wikipedia URL formatting. I want to make sure I'm doing the right thing.
On IIS, the URL for a MediaWiki installation typically looks like this:
http://host/optional-wiki-subfolder/index.php?title=article-name
...and so I want to translate that to:
http://host/optional-wiki-subfolder/article-name
In the derived class, I'm overwriting CHttpFilter::OnUrlMap. Is that right?
Also, I need to make sure that the URL is not rewritten if a directory exists under my main application path with what would be the article name. So far I have /forum, and I'm planning on adding /pub.
Is there a convenient way to enumerate folders under an IIS virtual path? Do I just use the Win32 API? Or, since I'm using MFC, is there an even more convenient way? :)
Thanks!
Ew, MFC.
</useless post>
Responded to this via MSN last night, but for the benefit of everyone else:
The answer should be to use GetServerVariable to query the PATH_TRANSLATED variable and operate on that. For ISAPI extensions (and not filters), you can use ServerSupportFunction with HSE_REQ_MAP_UNICODE_URL_TO_PATH.
Wow, you could do this in one line in .htaccess with apache.
Quote from: Maddox on June 05, 2006, 05:09 AM
Wow, you could do this in one line in .htaccess with apache.
Yes, I know, thank you. Unfortunately for other reasons I am not using Apache. That is why I wanted to know what a solution could be using MFC.