Solved

Redirect to secure site

Posted on 2003-11-23
1
746 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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 …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

16 Experts available now in Live!

Get 1:1 Help Now