Hi,
I am not a coder, but can get away with copying code into the .htacess file with php.
But now I have been asked to look after asp site, that is on a shared server. so looking for code to redirect non www to www and index.asp to / for seo reasons.
I have found a few posts regarding code and most are the same code or very similar to that below. But I can't get any of these similar examples to work.
So my questions are?
Do I put this code at the very top of the index.asp file, before the doctype command? If not, then that is probably what I am doing wrong.
The code below does not work on this shared server from a well know web host, has anyone had a similar issue and is there something I should do with the hosting?
<rule name="Redirect to www" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.com$" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
</rule>
Thanks