This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: URL-rewrite to URL without ’www’ Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
RvdH
Groupie
Groupie


Joined: 20 January 2004
Location: Netherlands
Online Status: Offline
Posts: 41
Posted: 27 May 2011 at 7:33am | IP Logged Quote RvdH

Hello all,

On the Helicon example-page there is an example which shows how to redirect from non-'www' version to 'www'. I want to accomplish the direct opposite. So, when someone type 'www.mysite.com', I want them to see 'http://mysite.com' in the address bar.

Can someone tell me how to do this? (or better, post the lines to accomplish this?)

Thx in advance!

RvdH
Back to Top View RvdH's Profile Search for other posts by RvdH
 
RvdH
Groupie
Groupie


Joined: 20 January 2004
Location: Netherlands
Online Status: Offline
Posts: 41
Posted: 27 May 2011 at 8:08am | IP Logged Quote RvdH

Ok, think i managed to have it working

#Adds www to *.domain.tld domains
#RewriteCond Host: (?!www\..*)([^.]+\.[^.]+)
#RewriteRule (.*) http\://www.$1$2 [I,RP]

#Remove www from *.domain.tld domains
RewriteCond Host: www\.([^.]+\.[^.]+)
RewriteRule (.*) http\://$1$2 [I,RP]
Back to Top View RvdH's Profile Search for other posts by RvdH
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 27 May 2011 at 8:30am | IP Logged Quote Anton

Yes, your rule is absolutely correct (unless you have smth like www.subdomain.domain.com).

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum