apache - Website Redirect on IIS -


on apache server, can website redirect placing .htaccess file on root folder following content:

rewriteengine on rewriterule ^(.*)$ http://www.newdomain.com/$1 [r=permanent,l] 

is possible same way (placing file on root folder redirect) on iis?

yes, add web.config file in place of .htaccess file.

web.config:

<?xml version="1.0" encoding="utf-8"?> <configuration>     <system.webserver>         <rewrite>             <rules>                 <rule name="redirectrule" stopprocessing="true">                     <match url="^(.*)$" />                     <action type="redirect" url="http://www.newdomain.com/{r:1}" />                 </rule>             </rules>         </rewrite>     </system.webserver> </configuration> 

more info here: http://www.iis.net/downloads/microsoft/url-rewrite


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -