Virtual Host Directive

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 20 Jun 2012, 03:50

Virtual Host Directive

20 Jun 2012, 04:04

Hello,

I have an IIS 6 web server with several virtual web sites.
One of these web sites has got the host header name.website.com, IP 1.2.3.4, SSL

In the http.conf file i try to add a http -> https rewriting for just this one web site:

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.89
# Registration info
RegistrationName= company info
RegistrationCode= XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

RewriteEngine on
RewriteLog "C:\DBA\iis\ISAPI_Rewrite3\rewrite.log"
RewriteLogLevel 9

#Rewrite Rule for web site
<VirtualHost name.website.com>
RewriteEngine on
AllowOverride all

#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]

#Redirect non-HTTPS to HTTPS
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://%1%2 [R,L]

</VirtualHost>

When i turn on the rewrite logging i see that the engine is working.
But I do not see any request for the name.website.com and the rewriting is not working.

In the access log of the website i do see the requests.
I tried .htaccess file in the web site root as well with no result.

Do you have any suggestions.

Thanks for your help,
Balt

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Virtual Host Directive

20 Jun 2012, 05:50

Hello, Balt

Please try to remove "AllowOverride all" line and check if anything will change.
Also try to remove the <VirtualHost> tags and check if the http->https rule will start working.
Add the following line into httpd.conf:

LogLevel debug

and provide error.log and rewrite.log records for the test request.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests