Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 26310

Rewrite to stop page being access via https

$
0
0

I only want specific pages of my site to be accessed via https - I don't want others being able to be indexed by search engines via both http and https to prevent any duplicate content issues.

Is there a way in IIS7 to stop this? I did create a rewrite rule that was looking for {HTTPS} to be on, and where request does not match "/secure/" but that breaks all CSS / Images / Javascript on secure pages.

<rule name="HTTPS to HTTP" enabled="false" stopProcessing="true"><match url="(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{URL}" pattern="/secure/" negate="true" /><add input="{HTTPS}" pattern="on" /></conditions><action type="Redirect" url="http://{HTTP_HOST}/{REQUEST_URI}" /></rule>



There must be an easy way to do this? I just can't wrap my head round what I need to ask it to do!

Thanks


Viewing all articles
Browse latest Browse all 26310

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>