LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 01-25-2008, 03:36 PM   #1
Oobydoobywapwap
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 wwwdomainname.com or domainname.com 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.

Thanks

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

Rep: Reputation: 30
Hi,

I found this which might be useful http://www.whoopis.com/howtos/apache-rewrite.html

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

Code:
<Directory /whatever_you_have>
    ...
    AllowOverride FileInfo Options
    ...
</Directory>
Also, make sure that you have uncommented (removed the # at the beginning of the line) the line that reads something like
Code:
LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so
(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.
 
  


Reply


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


All times are GMT -5. The time now is 11:20 PM.

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