Thanks Barney. You were right in that I needed to allow the rules in
..htaccess to override those in httpd.conf.
So in my VirtualHost I have:
<VirtualHost *:8080>
...
RewriteEngine On
RewriteOptions Inherit
</VirtualHost>
In httpd.conf:
<Directory my document root>
...
AllowOverride All
...
</Directory>
And then the rules are in .htaccess.
Does this sound about right?
The reason for wanting the rules in the .htaccess file is that the sites'
final resting place will be on IIS and I'd like to have the rules pertaining
to each site included in with all the other files.
Thanks for pointing me in the right direction.
Adrian
-----Original Message-----
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: 24 June 2008 22:32
To: CF-Talk
Subject: Re: (ot) mod_rewrite with VirtualHost and .htaccess
Check the .htaccess documentation from Apache. Basically you need to
ensure you have rights to use .htaccess configured in the main apache
file. Then you just stick your rules in there. Be aware of path
issues, however, since you're not in a global context, you're in the
context of the directory .htaccess lives in.
If you own the main config file(s), a better option would be to use
the Include directive to include an apache config file from each
virtual host, instead of using .htaccess. The former approach will be
more performant and less complicated, though it doesn't allow live
editing (i.e. changes require an Apache restart).
cheers,
barneyb
On Tue, Jun 24, 2008 at 2:14 PM, Adrian Lynch <[EMAIL PROTECTED]>
wrote:
> I'd like to have my rewrite rules in a .htaccess per site. I'm using
virtual
> hosts and everything I have read has said that I need to place the rules
in
> with the VirtualHost directive block or in httpd.config and then add the
> following lines to my v-hosts:
>
> RewriteEngine On
> RewriteOptions Inherit
>
> What I can't find reference to, and I can't get to work, is how to use
> ..htaccess with v-hosts where the .htaccess file is in the webroot for a
> given site.
>
> Any pointers would be greatly appreciated.
>
> Adrian Lynch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308094
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4