473,614 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VirtualHost Redirect to HTTPS, SSLRequireSSL? ModRewrite?

dlite922
1,584 Recognized Expert Top Contributor
I need help with redirecting virtualhosts to use HTTPS (SSL) when they type in HTTP

Must work in IE.

Right now there is two virtual host blocks for every subdomain.

I want to combine the virtual hosts so that I don't have one for port 80 (which basically gives you a page that says type https, UGH! ugly!), and one for port 443

Current Config:
Expand|Select|Wrap|Line Numbers
  1. <VirtualHost x.x.x.x:80>
  2.     ServerName sub1.example.com
  3.     DocumentRoot...
  4.     DirectoryIndex...
  5. </VirtualHost> 
  6.  
  7. <VirtualHost x.x.x.x:443>
  8.     ServerName sub1.example.com
  9.     SSL Engine on
  10.     SSLCertificateFile ...
  11.     SSLCertificateKeyFile...
  12.     SSLCertificateChainFile...
  13.     DocumentRoot...
  14.     DirectoryIndex...
  15. </VirtualHost> 
  16.  
  17.  
  18.  
  19.  
  20.  
How can I combine those to that if someone types in HTTP it redirects to HTTPS.

(I know its ModRewrite but I don't know how, GoogleSearch examples were confusing. )

SSLRequireSSL gives you an access denied page if not SSL?

thanks in advance,



Dan
Jul 3 '08 #1
0 4639

Sign in to post your reply or Sign up for a free account.

Similar topics

5
89891
by: Bob Hansen | last post by:
I am using the following code in my default.asp page to redirect the page from HTTP to HTTPS <% if Request.ServerVariables("HTTPS") = "off" Then Response.Redirect("https://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL"))
2
7796
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by a 128 bit SSL cert. The OWA 2003 server is running on Windows 2003 server in a Windows 2003 native AD domain. At present, the server is configured so that user's have to specifically go to the URL httpS://myserver.company.com in order to access...
3
14030
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to enter the absolute url like response.redirect("https://myProductionServer.com/SecurePage.aspx"), because when Im working in the development server I would have to change it back and forth everytime. Is there an easy way to do this without having...
2
4115
by: Sergej Prokoviev | last post by:
We are running our site at www.waynesavings.com on secure hosting (Server 2003, IIS). We are using a custom 403.4 error page (called 403_4.asp, located under root) to redirect all users to https if they come in on http. The site is also using an instant refresh on the index.htm page under root to www.waynesavings.com/aboutus/home.htm due to issues with the javascript menus used on the site. The code we're using on the custom 403 page is...
1
1357
by: mark Bannister | last post by:
Newbie here. Site is on shared server Apache, PHP 4.x I am using modrewrite currently for some other things but I was wondering about includes in php files. They don't seem to pass through ..htaccess and modrewrite. Is that correct? I have 3 days experience with .htaccess and modrewrite so I could well be doing something wrong. What I was trying to do is use a "fake" directory in all my includes that modrewrite would rewrite to the...
7
13439
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I checked require secure channel, require 128-bit encryption. In custom error, instead of using default message HTTP 403.4 - Forbidden: SSL required Internet Information Services in iishelp 403.4htm, I am trying to do redirect automatically. so I...
8
5134
by: howa | last post by:
a page currently in HTTPS, I force the client to redirect to another page using HTTP under the same domain (e.g. abc.com), i.e. header("Location: http://www.abc.com/index.php"); IE successfully redirect to HTTP, but FF & Opera stay on the HTTPS any suggestions?
1
6226
helimeef
by: helimeef | last post by:
Hey all, I'm having trouble setting up VirtualHosts on an Apache server running on Mac OS X 10.5 Leopard. I followed this tutorial, and everything is working (except VirtualHost of course). Okay, so here's the deal. If I run apachectl it says that there is no errors in the httpd.conf file. Here is the VirtualHost section of httpd.conf: <VirtualHost *> DocumentRoot /Library/WebServer/Documents/bonnielynd ServerName bonnielynd.local...
0
4343
by: Raven | last post by:
Hi, I have a problem with a server side redirect from a secure page to a non-secure page (same domain name, same folder) I have added some test code that can display the target URL and that containt http:// and yet it redirects to https:// example: I am on
0
8120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8265
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8423
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5537
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4115
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1705
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.