This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Nesting Location and VirtualHost sections Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Sabroni
Newbie
Newbie


Joined: 03 February 2012
Online Status: Offline
Posts: 3
Posted: 06 February 2012 at 9:05am | IP Logged Quote Sabroni

Hi,

Is it ok to nest a Location node inside a VirtualHost node
in an httpd.conf file? I want to rewrite urls for a
certain subfolder but only if the client is using a
specific domain name...

Thanks!
Sab
Back to Top View Sabroni's Profile Search for other posts by Sabroni
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -149
Posted: 07 February 2012 at 5:14am | IP Logged Quote Guests

Why don't you simply use:

Code:
RewriteCond %{HTTP:Host} ^www\.domain\.com$ [NC]
RewriteRule ^subdomain/(.*) /$1 [NC,L]


Regards
Andrew
Back to Top View Guests's Profile Search for other posts by Guests
 
Sabroni
Newbie
Newbie


Joined: 03 February 2012
Online Status: Offline
Posts: 3
Posted: 07 February 2012 at 5:39am | IP Logged Quote Sabroni

Hi Andrew,

Thanks for your reply. I have two sets of 9 url rewrites to do, one set for older devices and one for new devices. All devices will access the site through the same domain name.

To avoid duplicating rewrite condition in lots of places I want to route by user agent to one or another subfolder then apply the url rewrite rules based on the subfolder. I want to use virtual folders because the physical folders change when new versions are released but the virtual folders don't.

I need this rewriting to be specific to one domain name, users that connect to the site from other domain names should be able to avoid all the url rewrite rules.

Are you saying that I can't nest a Location node inside a VirtualHost node?

Cheers
Sab
Back to Top View Sabroni's Profile Search for other posts by Sabroni
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -149
Posted: 07 February 2012 at 6:49am | IP Logged Quote Guests

At the documentation for Location you can see "Context" section. It says "VirtualHost", which
means you CAN use it inside VirtualHost.

I was just wondering about the reason for usage.

Regards
Andrew
Back to Top View Guests's Profile Search for other posts by Guests
 
Sabroni
Newbie
Newbie


Joined: 03 February 2012
Online Status: Offline
Posts: 3
Posted: 07 February 2012 at 8:48am | IP Logged Quote Sabroni

Hi Andrew,

Excellent, thanks! I didn't want to waste time trying to fix my code if nesting wasn't supported...

Cheers!
Sab
Back to Top View Sabroni's Profile Search for other posts by Sabroni
 

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