Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 31 Dec 2016, 20:47
ekempter ekempter is offline
 
Join Date: Jun 2011
HTTPS redirect

I'm trying to redirect all HTTP traffic to HTTPS. The following within .htaccess works to a point. if abc.com is typed in, the URL correctly converts to https://www.abc.com/vb4/. It does not work when an http link is provided. http://www.abc.com/vb4/showthread.php/123-post comes back as https://www.abc.com/showthread.php/123-post. Note that the vb4 directory is stripped from the URL which results in a 404. Thanks in advance for any assistance.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.abc.com/$1 [R=301,L]
Reply With Quote
  #2  
Old 31 Dec 2016, 22:16
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
The htaccess rules you posted should work fine.
What happens when you disable those htaccess rules? Does it still happen or does it go to default behavior?
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #3  
Old 01 Jan 2017, 00:46
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
You could try changing (.*) to ^(.*)$, but I dont see why it would fail, unless maybe you have a RewriteBase messing things up in there somewhere.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #4  
Old 05 Jan 2017, 15:41
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Real name: Stratis
Originally Posted by ekempter View Post
I'm trying to redirect all HTTP traffic to HTTPS. The following within .htaccess works to a point. if abc.com is typed in, the URL correctly converts to https://www.abc.com/vb4/. It does not work when an http link is provided. http://www.abc.com/vb4/showthread.php/123-post comes back as https://www.abc.com/showthread.php/123-post. Note that the vb4 directory is stripped from the URL which results in a 404. Thanks in advance for any assistance.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.abc.com/$1 [R=301,L]

This was given for my use from server support.
---------------------------------------------------------------------
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
---------------------------------------------------------------------
Reply With Quote
  #5  
Old 06 Jan 2017, 17:44
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Best one for me is:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
__________________

Let us take care of your forum, seo, seo reports, maintenance, what ever you need.

Reply With Quote
  #6  
Old 06 Jan 2017, 18:09
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Real name: Stratis
Wow, this RewriteCond %{HTTPS} on
is absolute different than mine. Why so difference?
Do we know what "on" means?
Reply With Quote
Reply


Tags
htaccess, https


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


New To Site? Need Help?

All times are GMT. The time now is 13:45.

Layout Options | Width: Wide Color: