Redirects and web.config changes still make me extremely nervous, so I always like to ask before I actually do anything.
We recently upgraded to https and I set up a redirect from http to https. The problem I am having is that it is redirecting multiple times. From http://www to http://non-www and then again from http://non-www to https://non-www.
How can I redirect once? I've noticed a speed impact from doing it this way.
So, I would like to redirect both http://www and http://non-www to https://non-www for the entire domain.
I do have a couple of pages that have been redirected invidivually as well because the page has moved.
I'm using Windows hosting.
Here is my htaccess:
#Redirect from WWW to non WWW
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.[mysite].com [NC]
RewriteRule ^(.*)$ https://[mysite].com$1 [L,R=301]
Question
M_Lyons10
Good morning everyone!
Redirects and web.config changes still make me extremely nervous, so I always like to ask before I actually do anything.
We recently upgraded to https and I set up a redirect from http to https. The problem I am having is that it is redirecting multiple times. From http://www to http://non-www and then again from http://non-www to https://non-www.
How can I redirect once? I've noticed a speed impact from doing it this way.
So, I would like to redirect both http://www and http://non-www to https://non-www for the entire domain.
I do have a couple of pages that have been redirected invidivually as well because the page has moved.
I'm using Windows hosting.
Here is my htaccess:
#Redirect from WWW to non WWW
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.[mysite].com [NC]
RewriteRule ^(.*)$ https://[mysite].com$1 [L,R=301]
Thank you again for your help!
Link to comment
https://www.neowin.net/forum/topic/1383664-question-about-redirects-httpwww-to-httpsnon-www/Share on other sites
7 answers to this question
Recommended Posts