-1

I wanted to redirect my website nitroindia.org to www.nitroindia.org in windows hosting w.ith web.config file. I replaced the web.config file but It gave me a resultant 500 Internal Server error.

<?xml version=�1.0? encoding=�utf-8? ?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=�Redirect for ML2? stopProcessing=�true�>
<match url=�.*� />
<conditions>
<add input=�{HTTP_HOST}� pattern=�^nitroindia.org$� />
</conditions>
<action type=�Redirect� url=�http://www.nitroindia.org/{R:0}� redirectType=�Permanent� />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

My default file name is index.html

Rakete1111
  • 47,013
  • 16
  • 123
  • 162

1 Answers1

0

I'm guessing you are using IIS 7.5 and below should work:

<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Canonical host name">
<match url="^(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.domain\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.domain.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Godinall
  • 2,280
  • 1
  • 13
  • 18