Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 28th, 2003, 11:32 PM
wirespeed wirespeed is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 wirespeed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Auto Forward From HTTP to HTTPS?

I'm setting up a SSL secured part of my web site. Now most people are used to typing "subdomain.domain.com" in the address bar. If I use SSLRequireSSL for this site, they'll normally get a 403 error. Users: Huh?

What I did to combat this is in my .htaccess:

ErrorDocument 403 URL

Is this appropriate/recommended? Is it possible that this will result in an endless loop. If this doesn't work, what kind of error should I expect in return? 500?

Thanks

Reply With Quote
  #2  
Old March 1st, 2003, 12:42 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,569 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 22 h 42 m 51 sec
Reputation Power: 835
mod_rewrite might be a better solution if available.
Code:
RewriteEngine On
RewriteRule ^(.*)$ https://subdomain.domain.com/$1 [R,L]
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old March 14th, 2003, 10:40 AM
madsere madsere is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 madsere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You'll need a RewriteCond or something or it will just loop. I'm looking for a solution myself and can't get it to work. The closest suggestion is this from wirespeed, but it does not include the path/filename.

What I want is a rewriterule that automatically rewrites something like

URL

to

URL

Reply With Quote
  #4  
Old March 14th, 2003, 01:10 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,569 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 22 h 42 m 51 sec
Reputation Power: 835
I guess the RewriteRule I wrote works for me b/c I have separate folders for my http and https docs, so if I put that rule in .htaccess in my http folder, when it rewrites, it's not in my https folder.

For those without this server structure, check the SERVER_PROTOCOL.
Code:
RewriteEngine On
RewriteCond %{SERVER_PROTOCOL} ^[^https]$ [NC]
RewriteRule ^(.*)$ https://subdomain.domain.com/$1 [R,L]
The regular expression ^[^https]$ may need a little tweaking as I'm not entirely sure what all is returned as the protocol.

Reply With Quote
  #5  
Old March 14th, 2003, 04:31 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You can use RewriteCond %{SERVER_PORT} ^443$. Example can be found here

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

This could lead to a external redirect to https://subdomain.domain.com// (double slash) because ^(.*)$ portion has no slash.

BTW, just because you are asking about HTTPS does not mean it is a security question. You should still post this kind of topic to Apache forum.

Last edited by freebsd : March 14th, 2003 at 04:34 PM.

Reply With Quote
  #6  
Old March 15th, 2003, 12:16 AM
madsere madsere is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 madsere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Works fine as an addition in httpd.conf but I can't get it to work in a .htaccess file.

I've got "Options +FollowSymLinks" and things like "ErrorDocument" and other stuff works in .htaccess.

If the forum is inappropriate maybe a Mod could move the thread to wherever it belongs. It's the same to me, I use search anyway

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Auto Forward From HTTP to HTTPS?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT