Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 01-25-2008, 03:36 PM   #1
LQ Newbie
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
Unhappy Redirecting http to https on virtual server

First off, I know absolutely nothing about coding so please be gentle and reply as if I'm an idiot!

I have a website on a Linux based virtual server so it uses both ports 80 and 443. I need visitors to go to the https version of the site for payment collection but as most users will not type in https or http they are immediately directed to http.

I need a user who types or into the address bar to find that https://thedomainname opens in their webbrowser.

various forums have advised that the .htaccess file should read:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

and this should work. My htaccess files does read this, but it doesn't work.

Can anyone help!! Please speak very s-l-o-w-l-y if you are kind enough to do so.


Old 01-25-2008, 04:02 PM   #2
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30

I found this which might be useful

Also, you will have to ensure that you have configured Apache (in httpd.conf) to allow .htaccess to override settings.

<Directory /whatever_you_have>
    AllowOverride FileInfo Options
Also, make sure that you have uncommented (removed the # at the beginning of the line) the line that reads something like
LoadModule rewrite_module lib/httpd/modules/
(wherever your particular module is stored. The important part is that there is no # at the beginning of the line.

Hope that helps! I'm no expert on rewrite rules (I do all my redirection in PHP) so this is about where my usefulness ends.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 > single sign-on on both http and https server cbonar Linux - Server 11 11-03-2008 10:58 AM
redirecting https web page to http internal website baboow Linux - Server 2 12-17-2007 08:27 AM
LXer: Linux configure pound reverse proxy for Apache http / https web server LXer Syndicated Linux News 0 12-14-2007 07:20 PM
HTTPS and HTTP on same server Jake_B Linux - Software 2 11-28-2005 04:47 PM
redirecting http server xowl Linux - Networking 3 06-18-2005 04:25 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration