Solved

Redirect to secure site

Posted on 2003-11-23
1
750 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtual host in apache 31 108
Apache timeout remote connection if not port 80 10 98
Can't connect to WAMP server 5 79
Access blocked to XML files other than sitemap.xml? 4 36
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…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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