Virtual Host Directive
2 posts
• Page 1 of 1
Virtual Host Directive
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
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
Re: Virtual Host Directive
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.
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.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests