Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-19 Thread Nala Gnirut
It seems like I've managed to make it work like I wanted using this rule: * * * # Turn rewrite engine on RewriteEngine On # Fix missing trailing slashes for foo.mydomain.com RewriteCond %{HTTP_HOST} ^foo\.mydomain\.com$ [NC] RewriteCond %{DOCUMENT_ROOT}/foo%{REQUEST_URI}/ -d RewriteRule [^/]$ %{

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-18 Thread Nala Gnirut
On Sun, Mar 18, 2012 at 11:16 PM, Eric Covener wrote: > The P flag is explicitly used to proxy. If you want to redirect, > substitute a full URL and use the R flag instead. > I need to dynamically change DocumentRoot for some subdomains pointing to the same local path. This rule works (almost)

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-18 Thread Eric Covener
On Sun, Mar 18, 2012 at 5:56 PM, Nala Gnirut wrote: > After adapting to my folder structure it should look like > > RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.(.*)$ > RewriteRule ^/(.*) /%1/$1 [P] > > Unfortunately neither your original suggestion nor my version seem to cause > any redirection. The P

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-18 Thread Nala Gnirut
After adapting to my folder structure it should look like RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.(.*)$ RewriteRule ^/(.*) /%1/$1 [P] Unfortunately neither your original suggestion nor my version seem to cause any redirection. On Sat, Mar 17, 2012 at 3:09 PM, Igor Cicimov wrote: > Correction > >

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-17 Thread Igor Cicimov
Correction RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com$ RewriteRule ^/(.*) /%2/%1/$1 [P,L] On Sun, Mar 18, 2012 at 1:05 AM, Igor Cicimov wrote: > RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com$ > RewriteRule ^/(.*) /%2/%1 [P,L] > On Mar 18, 2012 12:58 AM, "Nala Gnirut" wrote: > >> Thanks, for the i

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-17 Thread Igor Cicimov
RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com$ RewriteRule ^/(.*) /%2/%1 [P,L] On Mar 18, 2012 12:58 AM, "Nala Gnirut" wrote: > Thanks, for the info. Unfortunately the suggested rule does not seem to > work as expected. > > Let me further explain what I'm trying to achieve: > > All *.mydomain.com su

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-17 Thread Nala Gnirut
Thanks, for the info. Unfortunately the suggested rule does not seem to work as expected. Let me further explain what I'm trying to achieve: All *.mydomain.com subdomains point to the same /mydomain/ local path as DocumentRoot (can't change this behavior due to shared hosting restrictions) and I'

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-16 Thread Igor Cicimov
RewriteCond %{HTTP_HOST} ^foo\.mydomain\.com$ RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^/(.*) /foo/$1 [L] sorry missed the ^ above. On Sat, Mar 17, 2012 at 1:49 PM, Igor Cicimov wrote: > First SERVER_NAME is apache internal NOT a http header sent with the > r

Re: [users@httpd] Issue with trailing slashes after rewrite

2012-03-16 Thread Igor Cicimov
First SERVER_NAME is apache internal NOT a http header sent with the request thus will match ANY request. Use HTTP_HOST instead. You also need to escape the dots in the host name. Second, from the documentation: "To combine new and old query strings, use the [QSA] flag." so by using QSA you are