This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Redirect www to non www with ASP.Net 4.0
Author
Message |
RR_noob
Newbie


Joined: 23 October 2011
Posts: 1
Posted: 23 October 2011 at 12:14am

Hi,

I realise that the www to non www subject has been done to death, but is there an example that works for .net 4.0? Specifically, that gets past the eurl.axd problem.

I saw this example (Redirect www. to non www):
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^www\.(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)?
RewriteRule ^(.*)(eurl.axd/.*)$ http(?%1s)://%2/$1
[R=301,L]

over here:
http://www.helicontech.com/forum/15029-ASPNET_40_MVC_and_ISAPI_Rewrite_3.html

However, does anyone have any code that does it for just one website (no https) so I can test it using the lite version before buying the full version?

Thanks.
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 24 October 2011 at 8:11am

Hello,

In case you want to hardcode the site name and use it only for http, try using:

RewriteCond %{HTTP} on
RewriteCond %{HTTP:Host} ^www\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} (.+)?
RewriteRule ^(.*)(eurl.axd/.*)$ http(?%1s)://domain\.com/$1 [R=301,L]

Regards
Andrew
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version