[Cialug] mod_rewrite QSA

Barry Von Ahsen barry at vonahsen.com
Thu Feb 2 12:36:35 CST 2006


If you mean

/path/to/website/
		/dir
		/otherdir

I think there you could do

<VirtualHost *:80>
	HostName website.com
	DocumentRoot /path/to/website/dir
	Alias /otherdir /path/to/website/otherdir
</VirtualHost>

I don't know of a way to serve files from both /path/to/website and 
/path/to/website/dir as website.com

-barry


Kevin C. Smith wrote:
> Since we are asking rewrite questions. What should an .htaccess file
> look like on a server using userdir mod. I want to rewrite anything going
> to http://www.example.com to http://www.example.com/dir/, but still allow
> things like http://www.example.com/otherdir.
> 
>> here's the magic incantation:
>>
>> <VirtualHost 10.10.0.42:80>
>>          ServerName rewritetest.vonahsen.com
>>          DocumentRoot /home/barry/public_html/
>>          RewriteEngine on
>>          RewriteCond %{QUERY_STRING} !.*now=.* [NC]
>>          RewriteRule ^/(.*) $1?now=%{TIME} [QSA,L,R]
>> </VirtualHost>
>>
>>
>> -barry
>>
>>
>> Dave Weis wrote:
>>> I think you need a rewrite condition to not rewrite if it has now=
>>> already there, then you can use QSA.
>>>
>>> On Wed, 1 Feb 2006, Barry Von Ahsen wrote:
>>>
>>>> I'm trying to setup an apache virtual host that will rewrite all
>>>> queries with the time to try to defeat some nasty caching proxies.
>>>> Has anyone used QSA?
>>>>
>>>> Here's my container:
>>>> <VirtualHost *:80>
>>>>        ServerName rewritetest.vonahsen.com
>>>>        DocumentRoot /home/barry/public_html/
>>>>        RewriteEngine on
>>>>        RewriteRule ^/(.*) $1?now=%{TIME} [L,R]
>>>> </VirtualHost>
>>>>
>>>>
>>>> This works, but doesn't preserve my previous query string -
>>>> rewritetest.vonahsen.com/index.php successfully rewrites to
>>>> index.php?now=20060201165503, and index.php?foo=bar redirects, but the
>>>> foo=bar gets clobbered by the now=
>>>>
>>>> changing to [QSA,L,R] excedes redirect limit
>>>>
>>>> anyone know how I can preserve the previous query string?  can I use
>>>> $1?%{QUERY_STRING}&now=%{TIME}
>>>>
>>>> -barry
>>>>
>>>>
>>>> _______________________________________________
>>>> Cialug mailing list
>>>> Cialug at cialug.org
>>>> http://cialug.org/mailman/listinfo/cialug
>>>>
>>
>> _______________________________________________
>> Cialug mailing list
>> Cialug at cialug.org
>> http://cialug.org/mailman/listinfo/cialug
>>
>>
>>
> 
> 




More information about the Cialug mailing list