#URLRewriteModule
Explore tagged Tumblr posts
ryadel · 7 years ago
Text
IIS URL Redirect HTTP to HTTPS excluding one or more folders
Tumblr media
If you've stumbled upon this post, it most likely means that you're trying to redirect all the HTTP requests coming to your website to the HTTPS channel using the IIS URL Rewrite module (in case you don't know what it is or if you need help installing it, check out this other post). To make things short, here's the rewrite rule you're probably looking for: Now, what if we want to keep one or more folders (and all their contents) accessible through HTTP? Here's a nice way to create an exception to the above rule adding a single additional line: As we can see, we took advantage of the negate="true" attribute to create an excluding input pattern, which - if matched - will prevent that rule from triggering: therefore, all the pages included in that folder will be accessible without SSL. Needless to say, you can add multiple input patterns to exclude additional folders from the HTTP-to-HTTPS mandatory redirect as well. Pretty neat, right? For additional info, check out the following IIS URL Rewrite Module resources by Microsoft: Using URL Rewrite Module 2.0 (including docs, guide, tutorials & samples) URL Rewrite Module - Video Walkthrough URL Rewrite Module - Community Forum URL Rewrite Module - Download Page That's it for now: I hope that this could help other IIS administrators that are struggling against this issue! Read the full article
0 notes
ryadel · 7 years ago
Text
IIS URL Redirect da HTTP a HTTPS escludendo una o più cartelle
Tumblr media
Se vi siete imbattuti in questo articolo, molto probabilmente significa che state cercando di trovare il modo di utilizzare le funzionalità di rewrite/redirect di IIS per reindirizzare tutte le richieste HTTP che arrivano sul vostro sito web su HTTPS SSL; visto che siete qui, daremo anche per scontato che stiate realizzando questo redirect con lo strumento IIS URL Rewrite (nel caso non sappiate cosa sia o se avete bisogno di aiuto per installarlo, date un'occhiata a quest'altro post). Per farla breve, ecco la regola di rewrite che probabilmente state cercando: Ora, cosa bisogna fare se volessimo escludere da questo redirect globale una o più cartelle (e tutto il loro contenuto), continuando a renderle accessibili tramite HTTP? Ecco un bel modo per creare un'eccezione alla regola di cui sopra aggiungendo una sola riga aggiuntiva: Come si può vedere, abbiamo sfruttato l'attributo negate="true" per creare un elemento input "escludente", ovvero che escluda dalla regola gli indirizzi che risultino positivi alla RegEx inserita: di conseguenza, nell'esempio di cui sopra, tutte le pagine incluse nella cartella /nossl/ continueranno ad essere accessibili tramite HTTP, senza che vi sia alcun redirect HTTPS / SSL. Inutile dire che è possibile aggiungere più elementi input al fine di escludere altre cartelle dal reindirizzamento obbligatorio HTTP-to-HTTPS. Per maggiori informazioni, consigliamo di dare un'occhiata alle seguenti risorse online che spiegano il funzionamento dello strumento IIS URL Rewrite di Microsoft: Using URL Rewrite Module 2.0 (documentazione, guide, tutorial ed esempi) URL Rewrite Module - Video Walkthrough URL Rewrite Module - Community Forum URL Rewrite Module - Download Page Per il momento è tutto: spero che questi due esempi possano essere d'aiuto ai tanti amministratori di sistema che si scontrano con questo tipo di problematiche. Alla prossima!   Read the full article
0 notes