Local uri problem

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 20 Apr 2013, 07:27

Local uri problem

20 Apr 2013, 07:54

Before releasing to the world, I like to test things. We'd like to do some clever things across two sites (a public and a portal subdomain). I'm an isapi_rewrite noob, so please bear with me...

I've installed isapi_rewrite 3.1.0.99 on a staging server, which is on our LAN. I've edited the hosts file of my local machine and the staging web server such that the target addresses (mydomain.com, www.mydomain.com, portal.mydomain.com) all have the IP address of the internal web server and that internal web server is configured with the relevant bindings.

Here's a rule:
Code: Select all
RewriteRule ^(www\.)?mydomain\.com/(\d{4})/?$ http://portal.mydomain.com/temp.html?$2 [R=301,L]

Things didn't go so well, so I've added RewriteLogLevel 9 and LogLevel debug. If I try browsing to mydomain.com/1234, log shows:
(2) init rewrite engine with requested uri /8162/
(3) applying pattern '^(www\.)?mydomain\.com/(\d{4})/?$' to uri '8162/'

Which doesn't match. Where's the full URI gone?!? Or maybe the question should be: how do I test within the building?

Thank you for your time!

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Local uri problem

21 Apr 2013, 23:54

Hello,

The matter is that the syntax of ISAPI_Rewrite requires the rule to be in the following format:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP:Host} ^(www\.)?mydomain\.com$ [NC]
RewriteRule ^(\d{4})/?$ http://portal.mydomain.com/temp.html?$2 [NC,R=301,L]


We have some useful links to help with your further learning of ISAPI_Rewrite3:
- FAQ - http://www.helicontech.com/forum/10648-FAQ.html
- Examples Section - http://www.helicontech.com/isapi_rewrite/doc/examples.htm
- Documentation - http://www.helicontech.com/isapi_rewrite/doc/

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests