Solved

Redirect to secure site

Posted on 2003-11-23
1
745 Views
Last Modified: 2010-05-18
I have an apache server running normally on port 80 and securely on port 443 as standard.  I only want connections to the secure site but i dont want to just comment out the Listen 80 line in the apache config document rather I would like it if someone connects to port 80, only 1 document can be viewed and all other pages will be shown as 404.  On this document would be a short ammount of text saying, this server is only available over a secure connection, please click the link below to connect securly, clicking the link would r-direct the user to https:// rather that http://

Anyone know how this is possible ??

Thanks !
0
Comment
Question by:Kevin_R
1 Comment
 
LVL 15

Accepted Solution

by:
periwinkle earned 500 total points
ID: 9819182
Sure - set up the configuration so that the SSL pages and the non-secure pages point to different document roots.  For example:

<VirtualHost 1.2.3.4:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /home/user/www
...
</VirtualHost>

<VirtualHost 1.2.3.4:443>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /home/user/securewww
...
</VirtualHost>



0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now