MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

how to remove www and set 301 on urlrewriter  (Mono Support )

Viewed 9960 time(s), 16 post(s) 1/21/2013 11:16:52 AMby deska5
super

super

2/20/2013 9:28:16 PM
Since I want the url to change from "domain.com" to "WWW.domain.com"

Is this correct ?


 <if header="HOST" match="^(http://domain.com)$">
  <redirect name="SiteCanonical" url="^(.*)$" to="http://www.domain.com" />
</if>
This content has not been rated yet. 
6018 Reputation 709 Total posts
mzilic

mzilic

2/20/2013 10:10:54 PM
Yes, this should work.

Regards,
Mario
This content has not been rated yet. 
2218 Reputation 300 Total posts
super

super

2/20/2013 10:35:17 PM
its not working....your previous code is working and making www.domain.com to domain.com but like i mentioned i want opposite....please double check on your end ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
mzilic

mzilic

2/20/2013 10:37:57 PM
Sorry didn't see this part, change http://domain.com to domain.com.
This content has not been rated yet. 
2218 Reputation 300 Total posts
super

super

2/21/2013 12:42:01 AM
it is working but seems like it is somehow affecting other things...

Now it does what it is supposed to do...if I type this in address bar "mydomain.com" it becomes "http://www.mydomain.com":

But the problem is...

Like, now I am not able to see pages that I added from administration side...

If I go to http://mydomain.com/MyNewPage.aspx,,, it redirect me to "www.mydomain.com"

why ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
mzilic

mzilic

2/21/2013 11:07:49 AM
Hello,

URL rewriting in MonoX is based on UrlRewriter.NET. You would need to check their support forums regarding this matter.

Regards,
Mario
This content has not been rated yet. 
2218 Reputation 300 Total posts
1 2