Created
March 28, 2017 16:51
-
-
Save fredrik-lundin/b528e1dd8faacc86c360f62731309dec to your computer and use it in GitHub Desktop.
web.config rewrite all requests to index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="redirect all requests" stopProcessing="true"> | |
<match url="^(.*)$" ignoreCase="false" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" /> | |
</conditions> | |
<action type="Rewrite" url="index.html" appendQueryString="true" /> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Hi, I'm really not a dev. needed this code in my website for a temporary redirection.
What should I put as "REQUEST_FILENAME}" Should I put Index.html(It's where I want the redirection to go) or should I put all the other .html that I dont want accessible? thanks!
Dude you are awesome.
Hi, I'm really not a dev. needed this code in my website for a temporary redirection.
What should I put as "REQUEST_FILENAME}" Should I put Index.html(It's where I want the redirection to go) or should I put all the other .html that I dont want accessible? thanks!
You don't need to change that, REQUEST_FILENAME is just a variable that represents whatever file has been requested. It will match requests to all other pages and make them inaccessible.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much