User Name
Password
AppleNova Forums » Programmer's Nook »

Redirecting HTTP to HTTPS not working... HOLP!


Register Members List Calendar Search FAQ Posting Guidelines
Redirecting HTTP to HTTPS not working... HOLP!
Thread Tools
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2021-09-29, 13:27

I have a subdomain that works fine with the cert as long a you hit it from HTTPS

But when I try it from HTTP she no worky.

I have read the recommendations from the host (MediaTemple) but it doesn't seem to work.

Code:
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^subdomain.domain.com [NC] RewriteRule ^(.*)$ http://subdomain.domain.com/$1 [R=301,L]


Your suggestions would be appreciated!!!



...

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2021-09-29, 13:36

When I check it with https://htaccess.madewithlove.be/ it all seems to check out, but it doesn't force the https??!!


...
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2021-09-29, 15:25

My Apache is a little rusty, but don't you want

RewriteRule ^(.*)$ https://subdomain.domain.com/$1 [R=301,L]

The RewriteCond (condition) is what the URL should match; the RewriteRule is what to do with it. So it should look like the result.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2021-09-29, 15:52

An Idiot : A Poem

y'all already knew i was an idiot,

but i was reminded today,

when the tech from the host did say:

mister, I had to rename the file to have a period

in front of the name because that is how

an HT access file works

also, this code is better:


Code:
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] Header always set Content-Security-Policy "upgrade-insecure-requests;"



My thanks to all who came here to laugh at me.

...

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2021-09-29, 16:51

Quote:
Originally Posted by drewprops View Post
mister, I had to rename the file to have a period

in front of the name because that is how

an HT access file works
Heh.

(One of the dumbest Unix conventions of all time, IMHO.)
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2021-09-30, 04:21

I have had insomnia tonight and as sunrise approaches and I'm getting ready to catch some sleep it occurred to me that the reason I didn't catch the mistake is because I'm getting older and less observant, and my eyesight isn't what it used to be.

Also: I really need to clean my laptop screen because I assume that some of the gunk are text characters!




...
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2021-09-30, 04:25

Quote:
Originally Posted by drewprops View Post
Also: I really need to clean my laptop screen because I assume that some of the gunk are text characters!
Oof, it me.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Safari redirecting Rehnquist Genius Bar 7 2007-07-11 16:00
Https drewprops Programmer's Nook 5 2006-09-25 19:49
Where did my MB http:// access go? turtle Genius Bar 3 2006-08-08 15:25
Redirecting Motivation. Wickers AppleOutsider 23 2006-07-02 01:46


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 00:42.


Powered by vBulletin®
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2021, AppleNova