Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 25 Jan 2017, 21:02
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Windows Server https:// redirect

I have the code below to redirect to https://www using web.config. Is this correct?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://www{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Also, how do I add this to the config? It already has <handlers></handlers>.. I just paste it in there above <system.webServer>
Thanks,
Rich
__________________

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


Last edited by RichieBoy67; 25 Jan 2017 at 21:10.
Reply With Quote
  #2  
Old 26 Jan 2017, 11:13
AWS's Avatar
AWS AWS is offline
 
Join Date: Nov 2001
Real name: Bob
You have a couple errors.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Set canonical domain for www like this.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 29 Jan 2017, 11:36
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Real name: Ryan
try my product =)
http://www.vbulletin.org/forum/showthread.php?t=322433
__________________
Sorry been away so long, new baby, got married, got into GM, just got to the point I can resume developing.
I'm working on a bunch of products, some free, some paid, and will release them all at once.
Dirt RIF CustUmz
Reply With Quote
  #4  
Old 29 Jan 2017, 13:28
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Real name: Stratis
Originally Posted by Dr.CustUmz View Post
Ryan, does it work in vb4.2xx ?
Thanks
Reply With Quote
  #5  
Old 29 Jan 2017, 22:05
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Real name: Ryan
there's no reason it shouldn't give it a shot and let me know, there are no settings for it. it is simply a plugin at the init_startup hook redirecting from http to https, if you do not already have https set up prior to installing it will not work.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Sorry been away so long, new baby, got married, got into GM, just got to the point I can resume developing.
I'm working on a bunch of products, some free, some paid, and will release them all at once.
Dirt RIF CustUmz
Reply With Quote
  #6  
Old 30 Jan 2017, 19:30
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Real name: Chris
redirects should ALWAYS be done at the server level!
__________________
Professional vB development since 2002.
References & Praise: 1|2|3|4|5|6|7|8
Reply With Quote
  #7  
Old 30 Jan 2017, 19:32
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Originally Posted by DivisionByZero View Post
redirects should ALWAYS be done at the server level!
#1 - I only have access to the forum and forum directory, not the root

#2 - Only the forum needs to be switched to https://
__________________

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

Reply With Quote
  #8  
Old 30 Jan 2017, 19:34
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Real name: Chris
.htaccess or web.config suffices as server-level config, per-directory too.
__________________
Professional vB development since 2002.
References & Praise: 1|2|3|4|5|6|7|8
Reply With Quote
  #9  
Old 30 Jan 2017, 19:37
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Thanks, but I know this much already. lol That is what I was trying to figure out. How to do the https:// in the web.config.. I think I got it now anyways but thanks much.
__________________

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

Reply With Quote
  #10  
Old 30 Jan 2017, 19:38
DivisionByZero's Avatar
DivisionByZero DivisionByZero is offline
 
Join Date: Dec 2002
Real name: Chris
ok. let me know if it doesn't work. i use windows server myself and have it setup somewhere.
__________________
Professional vB development since 2002.
References & Praise: 1|2|3|4|5|6|7|8
Reply With Quote
  #11  
Old 06 Feb 2017, 07:29
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Real name: Stratis
Does any one have solution for both redirect in .htaccess ?


http to https
non www to www

with 301

Thanks
Reply With Quote
  #12  
Old 10 Feb 2017, 15:22
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Real name: Richie
Originally Posted by Stratis View Post
Does any one have solution for both redirect in .htaccess ?


http to https
non www to www

with 301

Thanks
I use this:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
__________________

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

Reply With Quote
Reply


Tags
ssl, windows server


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 20:13.

Layout Options | Width: Wide Color: