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 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: domain.com equals to www.domain.com
Author
Message |
Seik
Newbie


Joined: 04 March 2011
Posts: 8
Posted: 23 March 2011 at 5:40pm

Hello
What rule I should add to that a URL type domain.com is the same as www.domain.com?

Thanks for the help
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 24 March 2011 at 3:51am

In ISAPI_Rewrite 2 is should be:

[ISAPI_Rewrite]

RewriteCond Host: domain\.com
RewriteRule (.*) http\://www.domain.com$1 [RP]

__________________
Regards,
Anton
Back to Top
 
Seik
Newbie


Joined: 04 March 2011
Posts: 8
Posted: 24 March 2011 at 7:27am

Can be rule general for multiple domains?, Or should include a rule for everyone domain?

Thanks for your response

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 25 March 2011 at 3:14am

If you want the rule to work for all domains on the server, simply put this into the global httpd.ini in ISAPI_Rewrite install dir:

[ISAPI_Rewrite]

RewriteCond Host: (?!www\..*)(.*\.com)
RewriteRule (.*) http\://www.$1$2 [RP]

__________________
Regards,
Anton
Back to Top
 
Seik
Newbie


Joined: 04 March 2011
Posts: 8
Posted: 28 March 2011 at 1:52am

Rule works perfectly, but what modification should I add for work with any domain extension(.com, .es, .org, .net, etc...)?

Thank you again
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 28 March 2011 at 2:51am

Please try to have it as follows:

[ISAPI_Rewrite]

RewriteCond Host: (?!www\..*)([^.]+\.[^.]+)
RewriteRule (.*) http\://www.$1$2 [RP]

__________________
Regards,
Anton
Back to Top
 
Seik
Newbie


Joined: 04 March 2011
Posts: 8
Posted: 28 March 2011 at 10:43am

Perfect ¡¡¡ Works perfectly. Thank you very much ¡¡
Back to Top
 

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

Printable version Printable version
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