vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   HTTPS redirect (https://vborg.vbsupport.ru/showthread.php?t=324102)

ekempter 12-31-2016 07:47 PM

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]

Dave 12-31-2016 09:16 PM

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?

Paul M 12-31-2016 11:46 PM

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.

Stratis 01-05-2017 02:41 PM

Quote:

Originally Posted by ekempter (Post 2580117)
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]
---------------------------------------------------------------------
:)

RichieBoy67 01-06-2017 04:44 PM

Best one for me is:

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

Stratis 01-06-2017 05:09 PM

Wow, this RewriteCond %{HTTPS} on
is absolute different than mine. Why so difference?
Do we know what "on" means?


All times are GMT. The time now is 11:40 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01043 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete