Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Run code on specific server Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
higgsy
Groupie
Groupie


Joined: 10 December 2004
Location: United Kingdom
Online Status: Offline
Posts: 68
Posted: 21 September 2008 at 3:23pm | IP Logged Quote higgsy

Hi,

Im using version 3 of Isapi_rewrite. Im using the standard redirect for non www traffic like so:

#IF ON SITE WITHOUT WWW.
#RewriteCond %{HTTPS} (on)?
#RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
#RewriteCond %{REQUEST_URI} (.+)
#RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

The problem is that we have a development machine, which uses dev.domain.com instead on www.domain.com

Can i extend the above so that it only executes on a specific machine - i was thinking it would be possible to use the server variables server_name but this is often returned as the domain name instead of the server name.

Any ideas?

Thanks
Al
Back to Top View higgsy's Profile Search for other posts by higgsy
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Online
Posts: 4841
Posted: 23 September 2008 at 1:51am | IP Logged Quote Anton

Please try to use the following:

RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!(?:www|dev)\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

__________________
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 can vote in polls in this forum