New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
IIS help - redirecting single page to HTTPS
IIS is a massive pain in the arse.
I need to redirect a single page to the HTTPS version. Try as I might, I don't seem to be able to do this. I'm sure it's because I'm being vaguely stupid, but I've been looking at it for 2 hours now and can't work out the issue.
I'm trying to do this via the URL Rewrite module - basically I need just the page http://www.domain.com/path/to/content to redirect to https://www.domain.com/path/to/content - results so far vary from absolutely nothing happening to a reboot loop.
Currently code looks something like this:
< rule name="HTTP to HTTPS" stopProcessing="true" > < match url="(*./content$)" / > < conditions > < add input="{HTTPS}" pattern="off" / > < /conditions > < action type="Redirect" url="https://{HTTP_HOST}/{R:0}" / > < /rule >
Which causes the redirect loop.
Halp.
Comments
...
Hit enter too early.
I just did a quick google and came up with
Looks slightly different from yours so it's worth a shot? (I have no experience with IIS so this is just a random guess)
Just throw the whole site under SSL?
Do you have to do it via web.config? You could just use (not tested a hacked draft) on the page (assuming ASP).
Ideally that's exactly what I'd do, but it's not possible in this instance.
Yes, I don't have access to the content. I need to be able to do this via the server.
EDIT: strictly speaking, I'm using rewrite maps, not writing directly to web.config. I don't think that makes a difference, but then IIS is a prick so who knows.