You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "J. Bakshi" <jo...@infoservices.in> on 2010/05/27 08:46:50 UTC

[users@httpd] .htaccess redirect issue

Hello list,

I am trying to achieve a very particular .htaccess redirect arrangement.
I have made it worked but halfway :-(

I have written a redirect rule as

`````````````````
RewriteCond %{HTTP_HOST} ^testyou.mydomain.com
RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
[R=301,L]

`````````````````````````

So http://testyou.mydomain.com should redirect to
http://www.mydomain.com\?domain=testyou.mydomain.com

But with the above rule the link redirects to

http://www.mydomain.com\?=testyou.mydomain.com

So without the *domain* in between.

Could any one suggest to

[1] how can I fixed this so the *domain* appears like
http://www.mydomain.com\?domain=testyou.mydomain.com

[2] Can there be any arrangement so that I can use bulk redirection ?
Say putting a variable in place of testyou.mydomain.com , so that those
two rules can effectively redirect all subdomains pointed to that server
? I don't know if it really possible. Any sugestion/clue please ?

Thanks

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by "J. Bakshi" <jo...@infoservices.in>.
On 05/27/2010 05:22 PM, Nilesh Govindarajan wrote:
> Guys stop fighting. The problem has been solved. That's all. (.)
>
>   

I have already kept myself silence Nilesh. Thanks for your kind clues
and also thanks to Tom as he has pointed out some really good links for me.

Wish you all a nice time.

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by Nilesh Govindarajan <li...@itech7.com>.
On Thu, May 27, 2010 at 3:18 PM, Tom Evans <te...@googlemail.com> wrote:
> On Thu, May 27, 2010 at 10:42 AM, J. Bakshi <jo...@infoservices.in> wrote:
>> On 05/27/2010 02:59 PM, Tom Evans wrote:
>>> On Thu, May 27, 2010 at 10:23 AM, J. Bakshi <jo...@infoservices.in> wrote:
>>>
>>>> Yes, I post here frequently and I get some really nice solution from
>>>> this list.  IS it an offense ?
>>>>
>>>>
>>>>
>>> You don't ever look to see what your solution could be, by using the
>>> resources provided - eg the excellent manual. You simply ask your
>>> obvious questions and produce mailing list noise. I consider that
>>> rude, but maybe I'm weird.
>>>
>>> I can understand a beginner doing this, but you are clearly not a beginner.
>>>
>>>
>>
>> This is not true.  I admit the link you have provided is useful and I
>> have not seen it before you pointed. Full credit to you. But it is not
>> that I ask my obvious question here without any search.  Anyways I can't
>> stop you to think such.
>>
>
> Thats exactly my point - that isn't revolutionary documentation.
> You're asking about 'redirect issues', but say you haven't ever
> bothered to read the manual sections on RewriteCond and RewriteRule.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


Guys stop fighting. The problem has been solved. That's all. (.)

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by Tom Evans <te...@googlemail.com>.
On Thu, May 27, 2010 at 10:42 AM, J. Bakshi <jo...@infoservices.in> wrote:
> On 05/27/2010 02:59 PM, Tom Evans wrote:
>> On Thu, May 27, 2010 at 10:23 AM, J. Bakshi <jo...@infoservices.in> wrote:
>>
>>> Yes, I post here frequently and I get some really nice solution from
>>> this list.  IS it an offense ?
>>>
>>>
>>>
>> You don't ever look to see what your solution could be, by using the
>> resources provided - eg the excellent manual. You simply ask your
>> obvious questions and produce mailing list noise. I consider that
>> rude, but maybe I'm weird.
>>
>> I can understand a beginner doing this, but you are clearly not a beginner.
>>
>>
>
> This is not true.  I admit the link you have provided is useful and I
> have not seen it before you pointed. Full credit to you. But it is not
> that I ask my obvious question here without any search.  Anyways I can't
> stop you to think such.
>

Thats exactly my point - that isn't revolutionary documentation.
You're asking about 'redirect issues', but say you haven't ever
bothered to read the manual sections on RewriteCond and RewriteRule.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by "J. Bakshi" <jo...@infoservices.in>.
On 05/27/2010 02:59 PM, Tom Evans wrote:
> On Thu, May 27, 2010 at 10:23 AM, J. Bakshi <jo...@infoservices.in> wrote:
>   
>> Yes, I post here frequently and I get some really nice solution from
>> this list.  IS it an offense ?
>>
>>
>>     
> You don't ever look to see what your solution could be, by using the
> resources provided - eg the excellent manual. You simply ask your
> obvious questions and produce mailing list noise. I consider that
> rude, but maybe I'm weird.
>
> I can understand a beginner doing this, but you are clearly not a beginner.
>
>   

This is not true.  I admit the link you have provided is useful and I
have not seen it before you pointed. Full credit to you. But it is not
that I ask my obvious question here without any search.  Anyways I can't
stop you to think such. 

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by Tom Evans <te...@googlemail.com>.
On Thu, May 27, 2010 at 10:23 AM, J. Bakshi <jo...@infoservices.in> wrote:
>
> Yes, I post here frequently and I get some really nice solution from
> this list.  IS it an offense ?
>
>

You don't ever look to see what your solution could be, by using the
resources provided - eg the excellent manual. You simply ask your
obvious questions and produce mailing list noise. I consider that
rude, but maybe I'm weird.

I can understand a beginner doing this, but you are clearly not a beginner.

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by "J. Bakshi" <jo...@infoservices.in>.
On 05/27/2010 02:33 PM, Tom Evans wrote:
> On Thu, May 27, 2010 at 9:50 AM, J. Bakshi <jo...@infoservices.in> wrote:
>   
>> On 05/27/2010 01:59 PM, Nilesh Govindarajan wrote:
>>     
>>> I assume that you want to redirect abcd.mydomain.com to
>>> www.mydomain.com/?domain=abcd.mydomain.com
>>> Considering that scenario and limiting subdomains only to
>>> mydomain.com, the following rule works (I've tested them on my
>>> server):
>>>
>>> RewriteEngine On
>>> RewriteCond %{HTTP_HOST} (.+).mydomain.com$
>>> RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST}
>>>
>>>
>>>       
>> Ok, but is it possible to extend these rule sets so that It can also
>> work with other domains too ? Say by using any variable in RewriteCond
>> which can hold the requested domain name and delivered it in the
>> RewriteRule
>>
>> Please let me know if it is possible.
>> Thanks
>>
>>     
> No offence meant here, but I see you posting here all the time. This
>   

Yes, I post here frequently and I get some really nice solution from
this list.  IS it an offense ?


> information is clearly explained in the apache manual, perhaps you may
> need to give it another glance, specifically at backreferences?
>
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
>
> RewriteCond %{HTTP_HOST} (.+)
> RewriteRule .* http://foo/?domain=%1
>
>
>   

Thanks for your help


-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by Tom Evans <te...@googlemail.com>.
On Thu, May 27, 2010 at 9:50 AM, J. Bakshi <jo...@infoservices.in> wrote:
> On 05/27/2010 01:59 PM, Nilesh Govindarajan wrote:
>> I assume that you want to redirect abcd.mydomain.com to
>> www.mydomain.com/?domain=abcd.mydomain.com
>> Considering that scenario and limiting subdomains only to
>> mydomain.com, the following rule works (I've tested them on my
>> server):
>>
>> RewriteEngine On
>> RewriteCond %{HTTP_HOST} (.+).mydomain.com$
>> RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST}
>>
>>
> Ok, but is it possible to extend these rule sets so that It can also
> work with other domains too ? Say by using any variable in RewriteCond
> which can hold the requested domain name and delivered it in the
> RewriteRule
>
> Please let me know if it is possible.
> Thanks
>

No offence meant here, but I see you posting here all the time. This
information is clearly explained in the apache manual, perhaps you may
need to give it another glance, specifically at backreferences?

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule

RewriteCond %{HTTP_HOST} (.+)
RewriteRule .* http://foo/?domain=%1

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by "J. Bakshi" <jo...@infoservices.in>.
On 05/27/2010 01:59 PM, Nilesh Govindarajan wrote:
> I assume that you want to redirect abcd.mydomain.com to
> www.mydomain.com/?domain=abcd.mydomain.com
> Considering that scenario and limiting subdomains only to
> mydomain.com, the following rule works (I've tested them on my
> server):
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} (.+).mydomain.com$
> RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST}
>
>   
Ok, but is it possible to extend these rule sets so that It can also
work with other domains too ? Say by using any variable in RewriteCond 
which can hold the requested domain name and delivered it in the 
RewriteRule

Please let me know if it is possible.
Thanks

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by Nilesh Govindarajan <li...@itech7.com>.
On Thu, May 27, 2010 at 1:45 PM, J. Bakshi <jo...@infoservices.in> wrote:
> On 05/27/2010 01:14 PM, Nilesh Govindarajan wrote:
>> On Thu, May 27, 2010 at 12:25 PM, J. Bakshi <jo...@infoservices.in> wrote:
>>
>>> On 05/27/2010 12:16 PM, J. Bakshi wrote:
>>>
>>>> Hello list,
>>>>
>>>> I am trying to achieve a very particular .htaccess redirect arrangement.
>>>> I have made it worked but halfway :-(
>>>>
>>>> I have written a redirect rule as
>>>>
>>>> `````````````````
>>>> RewriteCond %{HTTP_HOST} ^testyou.mydomain.com
>>>> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
>>>> [R=301,L]
>>>>
>>>> `````````````````````````
>>>>
>>>> So http://testyou.mydomain.com should redirect to
>>>> http://www.mydomain.com\?domain=testyou.mydomain.com
>>>>
>>>> But with the above rule the link redirects to
>>>>
>>>> http://www.mydomain.com\?=testyou.mydomain.com
>>>>
>>>> So without the *domain* in between.
>>>>
>>>> Could any one suggest to
>>>>
>>>> [1] how can I fixed this so the *domain* appears like
>>>> http://www.mydomain.com\?domain=testyou.mydomain.com
>>>>
>>>> [2] Can there be any arrangement so that I can use bulk redirection ?
>>>> Say putting a variable in place of testyou.mydomain.com , so that those
>>>> two rules can effectively redirect all subdomains pointed to that server
>>>> ? I don't know if it really possible. Any sugestion/clue please ?
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>> [1] is fixed  by
>>>
>>> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
>>> [R=301,L]
>>>
>>> [2] Is there any way to modify the rule for bulk domain or should I
>>> write the rule set for each individual domain ?
>>>
>>> Thanks for our time
>>>
>>>
>>> --
>>> জয়দীপ বক্সী
>>>
>>>
>>> ---------------------------------------------------------------------
>>> The official User-To-User support forum of the Apache HTTP Server Project.
>>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>>
>>
>> How you got [1] fixed, there's no change in the rule !
>>
>> For bulk redirection within subdomains I suggest this:
>>
>> RewrtieCond %{HTTP_HOST} (.+).mydomain.com$
>> RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST} [R=301]
>>
>>
>
>
> Hello Nilesh,
>
> Thank for your response.  But the rule produce an internal server error
> ( code 500 ).
>
> Presently what I am using for each individual domain are
>
> ```````````````````````````````````````
> RewriteCond %{HTTP_HOST} ^domain1.Adomain.com
> RewriteRule ^(.*)$ http://www.mytestsite.com\?domain=domain1.Adomain.com
> [R=301,L]
>
> RewriteCond %{HTTP_HOST} ^domain1.Bdomain.com
> RewriteRule ^(.*)$ http://www.mytestsite.com\?domain=domain1.Bdomain.com
> [R=301,L]
>
> ````````````````````````````````````````
>
> All the dub-domains ( domain1.Adomain.com etc...) are pointed to the server.
>
> --
> জয়দীপ বক্সী
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

I assume that you want to redirect abcd.mydomain.com to
www.mydomain.com/?domain=abcd.mydomain.com
Considering that scenario and limiting subdomains only to
mydomain.com, the following rule works (I've tested them on my
server):

RewriteEngine On
RewriteCond %{HTTP_HOST} (.+).mydomain.com$
RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST}

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by "J. Bakshi" <jo...@infoservices.in>.
On 05/27/2010 01:14 PM, Nilesh Govindarajan wrote:
> On Thu, May 27, 2010 at 12:25 PM, J. Bakshi <jo...@infoservices.in> wrote:
>   
>> On 05/27/2010 12:16 PM, J. Bakshi wrote:
>>     
>>> Hello list,
>>>
>>> I am trying to achieve a very particular .htaccess redirect arrangement.
>>> I have made it worked but halfway :-(
>>>
>>> I have written a redirect rule as
>>>
>>> `````````````````
>>> RewriteCond %{HTTP_HOST} ^testyou.mydomain.com
>>> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
>>> [R=301,L]
>>>
>>> `````````````````````````
>>>
>>> So http://testyou.mydomain.com should redirect to
>>> http://www.mydomain.com\?domain=testyou.mydomain.com
>>>
>>> But with the above rule the link redirects to
>>>
>>> http://www.mydomain.com\?=testyou.mydomain.com
>>>
>>> So without the *domain* in between.
>>>
>>> Could any one suggest to
>>>
>>> [1] how can I fixed this so the *domain* appears like
>>> http://www.mydomain.com\?domain=testyou.mydomain.com
>>>
>>> [2] Can there be any arrangement so that I can use bulk redirection ?
>>> Say putting a variable in place of testyou.mydomain.com , so that those
>>> two rules can effectively redirect all subdomains pointed to that server
>>> ? I don't know if it really possible. Any sugestion/clue please ?
>>>
>>> Thanks
>>>
>>>
>>>       
>> [1] is fixed  by
>>
>> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
>> [R=301,L]
>>
>> [2] Is there any way to modify the rule for bulk domain or should I
>> write the rule set for each individual domain ?
>>
>> Thanks for our time
>>
>>
>> --
>> জয়দীপ বক্সী
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>     
>
> How you got [1] fixed, there's no change in the rule !
>
> For bulk redirection within subdomains I suggest this:
>
> RewrtieCond %{HTTP_HOST} (.+).mydomain.com$
> RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST} [R=301]
>
>   


Hello Nilesh,

Thank for your response.  But the rule produce an internal server error
( code 500 ). 

Presently what I am using for each individual domain are

```````````````````````````````````````
RewriteCond %{HTTP_HOST} ^domain1.Adomain.com
RewriteRule ^(.*)$ http://www.mytestsite.com\?domain=domain1.Adomain.com
[R=301,L]

RewriteCond %{HTTP_HOST} ^domain1.Bdomain.com
RewriteRule ^(.*)$ http://www.mytestsite.com\?domain=domain1.Bdomain.com
[R=301,L]

````````````````````````````````````````

All the dub-domains ( domain1.Adomain.com etc...) are pointed to the server.

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by Nilesh Govindarajan <li...@itech7.com>.
On Thu, May 27, 2010 at 12:25 PM, J. Bakshi <jo...@infoservices.in> wrote:
> On 05/27/2010 12:16 PM, J. Bakshi wrote:
>> Hello list,
>>
>> I am trying to achieve a very particular .htaccess redirect arrangement.
>> I have made it worked but halfway :-(
>>
>> I have written a redirect rule as
>>
>> `````````````````
>> RewriteCond %{HTTP_HOST} ^testyou.mydomain.com
>> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
>> [R=301,L]
>>
>> `````````````````````````
>>
>> So http://testyou.mydomain.com should redirect to
>> http://www.mydomain.com\?domain=testyou.mydomain.com
>>
>> But with the above rule the link redirects to
>>
>> http://www.mydomain.com\?=testyou.mydomain.com
>>
>> So without the *domain* in between.
>>
>> Could any one suggest to
>>
>> [1] how can I fixed this so the *domain* appears like
>> http://www.mydomain.com\?domain=testyou.mydomain.com
>>
>> [2] Can there be any arrangement so that I can use bulk redirection ?
>> Say putting a variable in place of testyou.mydomain.com , so that those
>> two rules can effectively redirect all subdomains pointed to that server
>> ? I don't know if it really possible. Any sugestion/clue please ?
>>
>> Thanks
>>
>>
>
> [1] is fixed  by
>
> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
> [R=301,L]
>
> [2] Is there any way to modify the rule for bulk domain or should I
> write the rule set for each individual domain ?
>
> Thanks for our time
>
>
> --
> জয়দীপ বক্সী
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


How you got [1] fixed, there's no change in the rule !

For bulk redirection within subdomains I suggest this:

RewrtieCond %{HTTP_HOST} (.+).mydomain.com$
RewriteRule (.*) http://www.mydomain.com/?domain=%{HTTP_HOST} [R=301]

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] .htaccess redirect issue

Posted by "J. Bakshi" <jo...@infoservices.in>.
On 05/27/2010 12:16 PM, J. Bakshi wrote:
> Hello list,
>
> I am trying to achieve a very particular .htaccess redirect arrangement.
> I have made it worked but halfway :-(
>
> I have written a redirect rule as
>
> `````````````````
> RewriteCond %{HTTP_HOST} ^testyou.mydomain.com
> RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
> [R=301,L]
>
> `````````````````````````
>
> So http://testyou.mydomain.com should redirect to
> http://www.mydomain.com\?domain=testyou.mydomain.com
>
> But with the above rule the link redirects to
>
> http://www.mydomain.com\?=testyou.mydomain.com
>
> So without the *domain* in between.
>
> Could any one suggest to
>
> [1] how can I fixed this so the *domain* appears like
> http://www.mydomain.com\?domain=testyou.mydomain.com
>
> [2] Can there be any arrangement so that I can use bulk redirection ?
> Say putting a variable in place of testyou.mydomain.com , so that those
> two rules can effectively redirect all subdomains pointed to that server
> ? I don't know if it really possible. Any sugestion/clue please ?
>
> Thanks
>
>   

[1] is fixed  by

RewriteRule ^(.*)$ http://www.mydomain.com\?domain=testyou.mydomain.com
[R=301,L]

[2] Is there any way to modify the rule for bulk domain or should I
write the rule set for each individual domain ?

Thanks for our time


-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org