Avatar of FreerTool
FreerTool

asked on 

IIS 7 URL Rewrite Https with www to http nonwww

I have been struggling all day to get some old links to do a 301 redirect to my new links.

I am trying to get https://www.freertool.com/store/en/freer-naams-alb081m-2 to redirect to http://freertool.com/freer-naams-alb081m-2

<rule name="RedirectWWW" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^freertool\.com$" negate="true" />
                    </conditions>
                    <action type="Redirect" url="http://freertool.com/{R:1}" />
                </rule>
                <rule name="RemoveDirectory" enabled="true" stopProcessing="true">
                    <match url="^store/en/(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^freertool\.com$" negate="true" />
                    </conditions>
                    <action type="Redirect" url="http://freertool.com/{R:1}" redirectType="Permanent" />
                </rule>

Open in new window


What am I missing, I have been banging my head all day on this.
Microsoft IIS Web ServerSSL / HTTPSWeb Browsers

Avatar of undefined
Last Comment
Steve Bink
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

What is happening when you try to trigger that rule?  What are the logs telling you is happening?
Avatar of FreerTool
FreerTool

ASKER

I updated  my rules and can get every redirect to work except for https://www.freertool.com/store/en  links

for example  https://www.freertool.com/store/en/freer-naams-alb081 wont work but if i remove the S on HTTPS it goes through.

 I am just missing a step i believe should i create another rule to handle Https prior to loading the other rules?

    <rules>
                <clear />
                <rule name="Store Redirect Store www" stopProcessing="true">
                    <match url="^www.freertool.com/store(.*)" />
                    negate="true" />
                    <action type="Redirect" url="http://freertool.com{R:1}" />
                </rule>
                <rule name="Store Redirect EN" enabled="true" stopProcessing="true">
                    <match url="^en(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="http://freertool.com{R:1}" />
                </rule>
                <rule name="Store Redirect Store" stopProcessing="true">
                    <match url="^store(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Redirect" url="http://freertool.com{R:1}" />
                </rule>
                <rule name="Store Redirect www and en" enabled="true">
                    <match url="^www.freertool.com/store/en/(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    </conditions>
                    <action type="Rewrite" url="http://freertool.com{R:1}" />
                </rule>            
            </rules>
Avatar of FreerTool
FreerTool

ASKER

I can look at this 2 ways if i remove the www from link it redirects or if i remove the s on https it redirects.  I am just trying to figure out the condition combo to get this to work correctly
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of FreerTool
FreerTool

ASKER

I turned on tracing and now i find out that all my https:// google links aren't even getting served on the server, so i cant trace something that's not getting there any ideas or should i just remove them one by one from google webmaster?
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

What do you mean by "https:// google links"?  Are they going to your domain?
Avatar of FreerTool
FreerTool

ASKER

I have tracing turned on and if you click on the link for this https://www.freertool.com/store/en/freer-naams-alb081

the trace is not appearing in my log.  Does that make sense?
Avatar of FreerTool
FreerTool

ASKER

It seems to me that it has to do more with ssl.
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Can you verify that your server is fielding that request at all?  When you ping freertool.com, does the IP match the IP of your server?  Is the site (with and without SSL) configured to listen on that IP?  Do you see any hits in the access/activity log?
Web Browsers
Web Browsers

Web browsers are applications used primarily to display documents, files and media from the Internet, identified by a Uniform Resource Identifier (URI) that can be a page, image, video or other file. Some browsers require the use of add-ons or extensions to safely render the information they receive; others have systems built into them to perform the same functions.

42K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo