Reply
.htaccess https help
Old 09-05-2008, 06:05 PM .htaccess https help
Junior Talker

Posts: 1
Due to our SSL cert only being for our https://domain.com

when someone goes to https://www.domain.com

they get an aweful error in the browser

so, I want to forward: https://www.domain.com to https://domain.com

so I have tried multi configurations in the htaccess file and non have worked.




#hpps-rewite
RewriteCond %{HTTPS_HOST} ^www.midwestapplianceparts.com
RewriteRule (.*) https://midwestapplianceparts.com [R=301,L]

also this:

RewriteCond %{HTTPS_HOST} !^www.midwestapplianceparts.com
RewriteRule ^(.*)$ http://www.midwestapplianceparts.com/$1 [r=301,L]

and the browser says:

Redirect Loop

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

Please, any help would be awesome!
monkfunk is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 09-06-2008, 11:23 AM Re: .htaccess https help
Extreme Talker

Posts: 249
Location: Belgium, Antwerp, Zoersel
Well, as the browser says, it's a redirect loop.

When someone goed to https://www.midwestapplianceparts.com, het gets redirected to https://midwestapplianceparts.com, but because of the second rule, he gets re-redirected to http://www.midwestapplianceparts.com . The L which normally prevents this from happening won't work because of the R=301.

Try using just:

Code:
RewriteCond %{HTTPS_HOST} ^www\.midwestapplianceparts\.com
RewriteRule ^(.*)$ https://midwestapplianceparts.com/$1 [R=301,L]
The backslashes are there because dots are special characters in regular expressions, which are used in the RewriteCond.
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Old 09-10-2008, 03:14 PM Re: .htaccess https help
Average Talker

Posts: 24
Name: Will
This may be because essentially www and no www are actually the same place.

In the DNS, www is already pointed to the non-www location, essentially its a redirect in itself.

So when you go in and then post another redirect rule, it creates an infinite loop of sorts.
__________________
WEBster Computing Service - webcs.com
dedicated server and shared server
management and hosting since 1996
webcs is offline
Reply With Quote
View Public Profile Visit webcs's homepage!
 
Reply     « Reply to .htaccess https help
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12205 seconds with 12 queries