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 icici...@gmail.com
On Sun, Mar 18, 2012 at 5:56 PM, Nala Gnirut nala.gni...@gmail.com 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
On Sun, Mar 18, 2012 at 11:16 PM, Eric Covener cove...@gmail.com 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
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
RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com$
RewriteRule ^/(.*) /%2/%1 [P,L]
On Mar 18, 2012 12:58 AM, Nala Gnirut nala.gni...@gmail.com 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
Correction
RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com$
RewriteRule ^/(.*) /%2/%1/$1 [P,L]
On Sun, Mar 18, 2012 at 1:05 AM, Igor Cicimov icici...@gmail.com wrote:
RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.com$
RewriteRule ^/(.*) /%2/%1 [P,L]
On Mar 18, 2012 12:58 AM, Nala Gnirut
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
RewriteCond %{HTTP_HOST} ^foo\.mydomain\.com$ http://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 icici...@gmail.com wrote:
First SERVER_NAME is apache internal NOT a http header