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: Nesting Location and VirtualHost sections
Author
Message |
Sabroni
Newbie


Joined: 03 February 2012
Posts: 3
Posted: 06 February 2012 at 9:05am

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
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 07 February 2012 at 5:14am

Why don't you simply use:

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


Regards
Andrew
Back to Top
 
Sabroni
Newbie


Joined: 03 February 2012
Posts: 3
Posted: 07 February 2012 at 5:39am

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
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 07 February 2012 at 6:49am

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
 
Sabroni
Newbie


Joined: 03 February 2012
Posts: 3
Posted: 07 February 2012 at 8:48am

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
 

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

Printable version Printable version