Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

URL Rewrite

$
0
0

I currently have the following rewrite rules in my web.config which are working fine but I am worried that too many redirects may cause problem. Is there any other way of combining them together as possible?

<rewrite><rules><rule name="Redirect to WWW" stopProcessing="true"><match url="(.*)" /><conditions><add input="{HTTP_HOST}" pattern="^www\." negate="true" /></conditions><action type="Redirect" url="https://www.{HTTP_HOST}{HTTP_URL}" redirectType="Permanent" appendQueryString="false" /></rule><rule name="Redirect to HTTPS"><match url="(.*)" /><conditions><add input="{HTTPS}" pattern="OFF" /></conditions><action type="Redirect" url="https://{HTTP_HOST}{HTTP_URL}" redirectType="Permanent" appendQueryString="false" /></rule><rule name="Default document rewrite" stopProcessing="true"><match url="(.*)index.htm" /><action type="Redirect" url="{R:1}" redirectType="Permanent" /></rule><rule name="301 Redirect 1" stopProcessing="true"><match url="^hotels/riverside-holiday-village\.htm$" /><action type="Redirect" url="hotels/riverside.html" redirectType="Permanent" /></rule><rule name="301 Redirect 2" stopProcessing="true"><match url="^m/famagusta\.htm$" /><action type="Redirect" url="famagusta.htm" redirectType="Permanent" /></rule><rule name="301 Redirect 3" stopProcessing="true"><match url="^m/diving-holidays\.html$" /><action type="Redirect" url="diving-holidays.html" redirectType="Permanent" /></rule><rule name="301 Redirect 4" stopProcessing="true"><match url="^mobile/famagusta\.htm$" /><action type="Redirect" url="famagusta.htm" redirectType="Permanent" /></rule><rule name="301 Redirect 5" stopProcessing="true"><match url="^hotels/mimoza-hotel\.htm$" /><action type="Redirect" url="north-cyprus-hotels.htm" redirectType="Permanent" /></rule><rule name="301 Redirect 6" stopProcessing="true"><match url="^hotels/venus-beach-residences-hotel\.htm$" /><action type="Redirect" url="north-cyprus-hotels.htm" redirectType="Permanent" /></rule></rules><outboundRules><rule name="Add Strict-Transport-Security when HTTPS" enabled="true"><match serverVariable="RESPONSE_Strict_Transport_Security" pattern=".*" /><conditions><add input="{HTTPS}" pattern="on" ignoreCase="true" /></conditions><action type="Rewrite" value="max-age=31536000" /></rule></outboundRules></rewrite>

Thank you in advance.


Viewing all articles
Browse latest Browse all 780

Trending Articles



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