You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Steffan A. Cline" <st...@hldns.com> on 2012/11/08 23:59:55 UTC

[users@httpd] mod rewrite

I am trying to figure out a specific rewrite.

I have a default host set up to catch any domains not served on the
specific server. 

I am trying to direct unknown domains in a manner such as :

default domain would be domain.com

So, abc.com hits, it would be rewritten to

http://domain.com?domain=abc.com

or

http://domain.com/abc-com/

Any suggestions?


Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline  
Steffan@ExecuChoice.net                             Phoenix, Az
http://www.ExecuChoice.net                                  USA
AIM    : SteffanC                     Skype : steffancline
GOOGLE : Steffan.Cline@gmail.com        MSN : steffan@hldns.com
YAHOO  : Steffan_Cline		        ICQ : 57234309
---------------------------------------------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
On the rewrite rule, I was working on

RewriteRule ([\w]*)\.(.*) http://domain.com/$1-$2/

BUT what if there is anything before xxx.com like www.xxx.com? I am no pro
with regex but trying to find a way around that.



Thanks

Steffan


On 11/26/12 10:46 AM, "Steffan A. Cline" <st...@hldns.com> wrote:

> Igor,
> 
> I am not sure what you mean. The ?domain=xxx.com option works great.
> 
> I was just wondering if there was a way to change it from ?domain=xxx.com to
> /xxx-com/ simply changing the . to a -
> 
> Is it possible? I didn't know if it was possible to put that into a regex
> replacement of a sort.
> 
> 
> 
> Thanks
> 
> Steffan
> 
> 
> On 11/26/12 12:53 AM, "Igor Cicimov" <ic...@gmail.com> wrote:
> 
>> 
>> 
>> On 26/11/2012 4:17 PM, "Steffan A. Cline" <st...@hldns.com> wrote:
>>> >
>>> > Is there a way to rewrite the HTTP_HOST where the . Is changed to a - ?
>>> >
>>> > HTTP_HOST= something.com <http://something.com>
>>> > Redirects to domain.com/something-com/ <http://domain.com/something-com/>
>>> >
>>> > Is it possible?
>> 
>> There is nothing to rewrite here. You need to do what you already said above,
>> redirect the domain something to the other url.
>> 
>>> >
>>> >
>>> > Thanks
>>> >
>>> > Steffan
>>> >
>>> >
>>> > On 11/8/12 11:38 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>> >
>>>> >> RewriteEngine On
>>>> >> RewriteCond %{HTTP_HOST} !^(www\.)?domain.com <http://domain.com> $ [NC]
>>>> >> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Fri, Nov 9, 2012 at 3:36 PM, Steffan A. Cline <st...@hldns.com>
>>>> wrote:
>>>>> >>>
>>>>> >>> Works a charm with one exception.
>>>>> >>>
>>>>> >>> www.domain.com <http://www.domain.com>  redirects to
>>>>> domain.com?domain=www.domain.com <http://domain.com?domain=www.domain.com>
>>>>> >>>
>>>>> >>> Anyway to fix that? www.domain.com <http://www.domain.com>  should be
>>>>> ignored since that is the domain itself.
>>>>> >>>
>>>>> >>>
>>>>> >>> Thanks
>>>>> >>>
>>>>> >>> Steffan
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>>> >>>
>>>>>> >>>> RewriteEngine On
>>>>>> >>>> RewriteCond %{HTTP_HOST} !^domain.com <http://domain.com> $ [NC]
>>>>>> >>>> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com>
>>>>>> wrote:
>>>>>>> >>>>>
>>>>>>> >>>>> Thanks for the URL. I did not read this one, but a similar one
>>>>>>> also on the site.
>>>>>>> >>>>>
>>>>>>> >>>>> I did not blindly ask for suggestions without trying it first.
>>>>>>> >>>>>
>>>>>>> >>>>> The issue I ran into was too many redirects. Clearly I didn't get
>>>>>>> it right and hoped someone may have something worth trying.
>>>>>>> >>>>>
>>>>>>> >>>>> Thanks
>>>>>>> >>>>>
>>>>>>> >>>>> Steffan
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>>>>> >>>>>
>>>>>>>> >>>>>>
>>>>>>>> >>>>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline
>>>>>>>> <st...@hldns.com> wrote:
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> I am trying to figure out a specific rewrite.
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> I have a default host set up to catch any domains not served
on the
>>>>>>>>> >>>>>>> specific server.
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> I am trying to direct unknown domains in a manner such as :
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> default domain would be domain.com <http://domain.com>
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> http://domain.com?domain=abc.com
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> or
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> http://domain.com/abc-com/
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> Any suggestions?
>>>>>>>> >>>>>>
>>>>>>>> >>>>>>
>>>>>>>> >>>>>> Yes, read the mod_rewrite page its all in there
>>>>>>>> >>>>>>
>>>>>>>> >>>>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>>>>>> >>>>>>  
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> Thanks
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> Steffan
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>>
>>>>>>>>> >>>>>>> 
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>>>>>> >>>>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>
>>>>>> >>>>
>>>> >>



Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
Igor,

I am not sure what you mean. The ?domain=xxx.com option works great.

I was just wondering if there was a way to change it from ?domain=xxx.com to
/xxx-com/ simply changing the . to a -

Is it possible? I didn't know if it was possible to put that into a regex
replacement of a sort.



Thanks

Steffan


On 11/26/12 12:53 AM, "Igor Cicimov" <ic...@gmail.com> wrote:

> 
> 
> On 26/11/2012 4:17 PM, "Steffan A. Cline" <st...@hldns.com> wrote:
>> >
>> > Is there a way to rewrite the HTTP_HOST where the . Is changed to a - ?
>> >
>> > HTTP_HOST= something.com <http://something.com>
>> > Redirects to domain.com/something-com/ <http://domain.com/something-com/>
>> >
>> > Is it possible?
> 
> There is nothing to rewrite here. You need to do what you already said above,
> redirect the domain something to the other url.
> 
>> >
>> >
>> > Thanks
>> >
>> > Steffan
>> >
>> >
>> > On 11/8/12 11:38 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>> >
>>> >> RewriteEngine On
>>> >> RewriteCond %{HTTP_HOST} !^(www\.)?domain.com <http://domain.com> $ [NC]
>>> >> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On Fri, Nov 9, 2012 at 3:36 PM, Steffan A. Cline <st...@hldns.com>
>>> wrote:
>>>> >>>
>>>> >>> Works a charm with one exception.
>>>> >>>
>>>> >>> www.domain.com <http://www.domain.com>  redirects to
>>>> domain.com?domain=www.domain.com <http://domain.com?domain=www.domain.com>
>>>> >>>
>>>> >>> Anyway to fix that? www.domain.com <http://www.domain.com>  should be
>>>> ignored since that is the domain itself.
>>>> >>>
>>>> >>>
>>>> >>> Thanks
>>>> >>>
>>>> >>> Steffan
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>> >>>
>>>>> >>>> RewriteEngine On
>>>>> >>>> RewriteCond %{HTTP_HOST} !^domain.com <http://domain.com> $ [NC]
>>>>> >>>> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com>
>>>>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Thanks for the URL. I did not read this one, but a similar one also
>>>>>> on the site.
>>>>>> >>>>>
>>>>>> >>>>> I did not blindly ask for suggestions without trying it first.
>>>>>> >>>>>
>>>>>> >>>>> The issue I ran into was too many redirects. Clearly I didn't get
>>>>>> it right and hoped someone may have something worth trying.
>>>>>> >>>>>
>>>>>> >>>>> Thanks
>>>>>> >>>>>
>>>>>> >>>>> Steffan
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>>>> >>>>>
>>>>>>> >>>>>>
>>>>>>> >>>>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline
>>>>>>> <st...@hldns.com> wrote:
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> I am trying to figure out a specific rewrite.
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> I have a default host set up to catch any domains not served on
the
>>>>>>>> >>>>>>> specific server.
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> I am trying to direct unknown domains in a manner such as :
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> default domain would be domain.com <http://domain.com>
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> http://domain.com?domain=abc.com
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> or
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> http://domain.com/abc-com/
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> Any suggestions?
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>> >>>>>> Yes, read the mod_rewrite page its all in there
>>>>>>> >>>>>>
>>>>>>> >>>>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>>>>> >>>>>>  
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> Thanks
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> Steffan
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>>
>>>>>>>> >>>>>>> 
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>>>>> >>>>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>>>>> >>>>>>>
>>>>>>> >>>>>>
>>>>> >>>>
>>> >>



Re: [users@httpd] mod rewrite

Posted by Igor Cicimov <ic...@gmail.com>.
On 26/11/2012 4:17 PM, "Steffan A. Cline" <st...@hldns.com> wrote:
>
> Is there a way to rewrite the HTTP_HOST where the . Is changed to a - ?
>
> HTTP_HOST= something.com
> Redirects to domain.com/something-com/
>
> Is it possible?

There is nothing to rewrite here. You need to do what you already said
above, redirect the domain something to the other url.

>
>
> Thanks
>
> Steffan
>
>
> On 11/8/12 11:38 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>
>> RewriteEngine On
>> RewriteCond %{HTTP_HOST} !^(www\.)?domain.com$ [NC]
>> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>
>>
>>
>>
>> On Fri, Nov 9, 2012 at 3:36 PM, Steffan A. Cline <st...@hldns.com>
wrote:
>>>
>>> Works a charm with one exception.
>>>
>>> www.domain.com redirects to domain.com?domain=www.domain.com
>>>
>>> Anyway to fix that? www.domain.com should be ignored since that is the
domain itself.
>>>
>>>
>>> Thanks
>>>
>>> Steffan
>>>
>>>
>>>
>>>
>>> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>
>>>> RewriteEngine On
>>>> RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
>>>> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>>>
>>>>
>>>> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com>
wrote:
>>>>>
>>>>> Thanks for the URL. I did not read this one, but a similar one also
on the site.
>>>>>
>>>>> I did not blindly ask for suggestions without trying it first.
>>>>>
>>>>> The issue I ran into was too many redirects. Clearly I didn't get it
right and hoped someone may have something worth trying.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Steffan
>>>>>
>>>>>
>>>>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com>
wrote:
>>>>>>>
>>>>>>> I am trying to figure out a specific rewrite.
>>>>>>>
>>>>>>> I have a default host set up to catch any domains not served on the
>>>>>>> specific server.
>>>>>>>
>>>>>>> I am trying to direct unknown domains in a manner such as :
>>>>>>>
>>>>>>> default domain would be domain.com
>>>>>>>
>>>>>>> So, abc.com hits, it would be rewritten to
>>>>>>>
>>>>>>> http://domain.com?domain=abc.com
>>>>>>>
>>>>>>> or
>>>>>>>
>>>>>>> http://domain.com/abc-com/
>>>>>>>
>>>>>>> Any suggestions?
>>>>>>
>>>>>>
>>>>>> Yes, read the mod_rewrite page its all in there
>>>>>>
>>>>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Steffan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>>>>
>>>>>>
>>>>
>>

Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
Is there a way to rewrite the HTTP_HOST where the . Is changed to a - ?

HTTP_HOST= something.com
Redirects to domain.com/something-com/

Is it possible?


Thanks

Steffan


On 11/8/12 11:38 PM, "Igor Cicimov" <ic...@gmail.com> wrote:

> RewriteEngine On 
> RewriteCond %{HTTP_HOST} !^(www\.)?domain.com <http://domain.com> $ [NC]
> RewriteRule .* http://domain.com?domain=%{HTTP_HOST}
> <http://domain.com?domain=%%7BHTTP_HOST%7D>  [R,L]
> 
> 
> 
> 
> On Fri, Nov 9, 2012 at 3:36 PM, Steffan A. Cline <st...@hldns.com> wrote:
>> Works a charm with one exception.
>> 
>> www.domain.com <http://www.domain.com>  redirects to
>> domain.com?domain=www.domain.com <http://domain.com?domain=www.domain.com>
>> 
>> Anyway to fix that? www.domain.com <http://www.domain.com>  should be ignored
>> since that is the domain itself.
>> 
>> 
>> Thanks
>> 
>> Steffan
>> 
>> 
>> 
>> 
>> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>> 
>>> RewriteEngine On
>>> RewriteCond %{HTTP_HOST} !^domain.com <http://domain.com> $ [NC]
>>> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>>> 
>>> 
>>> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com> wrote:
>>>> Thanks for the URL. I did not read this one, but a similar one also on the
>>>> site.
>>>> 
>>>> I did not blindly ask for suggestions without trying it first.
>>>> 
>>>> The issue I ran into was too many redirects. Clearly I didn't get it right
>>>> and hoped someone may have something worth trying.
>>>> 
>>>> Thanks
>>>> 
>>>> Steffan
>>>> 
>>>> 
>>>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>>> 
>>>>> 
>>>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com>
>>>>> wrote:
>>>>>> I am trying to figure out a specific rewrite.
>>>>>> 
>>>>>> I have a default host set up to catch any domains not served on the
>>>>>> specific server.
>>>>>> 
>>>>>> I am trying to direct unknown domains in a manner such as :
>>>>>> 
>>>>>> default domain would be domain.com <http://domain.com>
>>>>>> 
>>>>>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>>>>>> 
>>>>>> http://domain.com?domain=abc.com
>>>>>> 
>>>>>> or
>>>>>> 
>>>>>> http://domain.com/abc-com/
>>>>>> 
>>>>>> Any suggestions?
>>>>> 
>>>>> Yes, read the mod_rewrite page its all in there
>>>>> 
>>>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>>>  
>>>>>> 
>>>>>> 
>>>>>> Thanks
>>>>>> 
>>>>>> Steffan
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>>> 
>>>>> 
>>> 
> 



Re: [users@httpd] mod rewrite

Posted by Igor Cicimov <ic...@gmail.com>.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?domain.com <http://domain.com>$ [NC]
RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]




On Fri, Nov 9, 2012 at 3:36 PM, Steffan A. Cline <st...@hldns.com> wrote:

> Works a charm with one exception.
>
> www.domain.com redirects to domain.com?domain=www.domain.com
>
> Anyway to fix that? www.domain.com should be ignored since that is the
> domain itself.
>
>
> Thanks
>
> Steffan
>
>
>
>
> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>
>
> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com>wrote:
>
>> Thanks for the URL. I did not read this one, but a similar one also on
>> the site.
>>
>> I did not blindly ask for suggestions without trying it first.
>>
>> The issue I ran into was too many redirects. Clearly I didn't get it
>> right and hoped someone may have something worth trying.
>>
>> Thanks
>>
>> Steffan
>>
>>
>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>
>>
>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com>wrote:
>>
>>> I am trying to figure out a specific rewrite.
>>>
>>> I have a default host set up to catch any domains not served on the
>>> specific server.
>>>
>>> I am trying to direct unknown domains in a manner such as :
>>>
>>> default domain would be domain.com
>>>
>>> So, abc.com hits, it would be rewritten to
>>>
>>> http://domain.com?domain=abc.com
>>>
>>> or
>>>
>>> http://domain.com/abc-com/
>>>
>>> Any suggestions?
>>>
>>
>> Yes, read the mod_rewrite page its all in there
>>
>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>
>>
>>>
>>>
>>> Thanks
>>>
>>> Steffan
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>
>

Re: [users@httpd] mod rewrite

Posted by Igor Cicimov <ic...@gmail.com>.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?domain.com <http://domain.com>$ [NC]
RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]


On Fri, Nov 9, 2012 at 3:48 PM, Steffan A. Cline <st...@hldns.com> wrote:

> Cancel that… Thanks Igor. Here is what I have and it works great!!
>
>
> RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
> RewriteRule ^(.*)$ http://domain.com$1 [R=301,L]
> RewriteCond %{HTTP_HOST} !^namedeli.com$ [NC]
> RewriteRule .* http://domain.com/?domain=%{HTTP_HOST} [R,L]
>
>
> Thanks
>
> Steffan
>
>
>
> On 11/8/12 9:36 PM, "Steffan A. Cline" <st...@hldns.com> wrote:
>
> Works a charm with one exception.
>
> www.domain.com redirects to domain.com?domain=www.domain.com
>
> Anyway to fix that? www.domain.com should be ignored since that is the
> domain itself.
>
>
> Thanks
>
> Steffan
>
>
>
>
> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>
>
> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com>wrote:
>
>> Thanks for the URL. I did not read this one, but a similar one also on
>> the site.
>>
>> I did not blindly ask for suggestions without trying it first.
>>
>> The issue I ran into was too many redirects. Clearly I didn't get it
>> right and hoped someone may have something worth trying.
>>
>> Thanks
>>
>> Steffan
>>
>>
>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>
>>
>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com>wrote:
>>
>>> I am trying to figure out a specific rewrite.
>>>
>>> I have a default host set up to catch any domains not served on the
>>> specific server.
>>>
>>> I am trying to direct unknown domains in a manner such as :
>>>
>>> default domain would be domain.com
>>>
>>> So, abc.com hits, it would be rewritten to
>>>
>>> http://domain.com?domain=abc.com
>>>
>>> or
>>>
>>> http://domain.com/abc-com/
>>>
>>> Any suggestions?
>>>
>>
>> Yes, read the mod_rewrite page its all in there
>>
>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>
>>
>>>
>>>
>>> Thanks
>>>
>>> Steffan
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>
>

Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
Cancel thatŠ Thanks Igor. Here is what I have and it works great!!


RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^namedeli.com$ [NC]
RewriteRule .* http://domain.com/?domain=%{HTTP_HOST} [R,L]


Thanks

Steffan



On 11/8/12 9:36 PM, "Steffan A. Cline" <st...@hldns.com> wrote:

> Works a charm with one exception.
> 
> www.domain.com redirects to domain.com?domain=www.domain.com
> 
> Anyway to fix that? www.domain.com should be ignored since that is the domain
> itself.
> 
> 
> Thanks
> 
> Steffan
> 
> 
> 
> 
> On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
> 
>> RewriteEngine On
>> RewriteCond %{HTTP_HOST} !^domain.com <http://domain.com> $ [NC]
>> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
>> 
>> 
>> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com> wrote:
>>> Thanks for the URL. I did not read this one, but a similar one also on the
>>> site.
>>> 
>>> I did not blindly ask for suggestions without trying it first.
>>> 
>>> The issue I ran into was too many redirects. Clearly I didn't get it right
>>> and hoped someone may have something worth trying.
>>> 
>>> Thanks
>>> 
>>> Steffan
>>> 
>>> 
>>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>>> 
>>>> 
>>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com> wrote:
>>>>> I am trying to figure out a specific rewrite.
>>>>> 
>>>>> I have a default host set up to catch any domains not served on the
>>>>> specific server.
>>>>> 
>>>>> I am trying to direct unknown domains in a manner such as :
>>>>> 
>>>>> default domain would be domain.com <http://domain.com>
>>>>> 
>>>>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>>>>> 
>>>>> http://domain.com?domain=abc.com
>>>>> 
>>>>> or
>>>>> 
>>>>> http://domain.com/abc-com/
>>>>> 
>>>>> Any suggestions?
>>>> 
>>>> Yes, read the mod_rewrite page its all in there
>>>> 
>>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>>  
>>>>> 
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> Steffan
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>> 
>>>> 
>> 



Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
Works a charm with one exception.

www.domain.com redirects to domain.com?domain=www.domain.com

Anyway to fix that? www.domain.com should be ignored since that is the
domain itself.


Thanks

Steffan




On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:

> RewriteEngine On 
> RewriteCond %{HTTP_HOST} !^domain.com <http://domain.com> $ [NC]
> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
> 
> 
> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com> wrote:
>> Thanks for the URL. I did not read this one, but a similar one also on the
>> site.
>> 
>> I did not blindly ask for suggestions without trying it first.
>> 
>> The issue I ran into was too many redirects. Clearly I didn't get it right
>> and hoped someone may have something worth trying.
>> 
>> Thanks
>> 
>> Steffan
>> 
>> 
>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>> 
>>> 
>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com> wrote:
>>>> I am trying to figure out a specific rewrite.
>>>> 
>>>> I have a default host set up to catch any domains not served on the
>>>> specific server.
>>>> 
>>>> I am trying to direct unknown domains in a manner such as :
>>>> 
>>>> default domain would be domain.com <http://domain.com>
>>>> 
>>>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>>>> 
>>>> http://domain.com?domain=abc.com
>>>> 
>>>> or
>>>> 
>>>> http://domain.com/abc-com/
>>>> 
>>>> Any suggestions?
>>> 
>>> Yes, read the mod_rewrite page its all in there
>>> 
>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>  
>>>> 
>>>> 
>>>> Thanks
>>>> 
>>>> Steffan
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>> 
>>> 
> 



Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
I'll give this a shot!

Thank you, Igor!




Thanks

Steffan


On 11/8/12 7:24 PM, "Igor Cicimov" <ic...@gmail.com> wrote:

> RewriteEngine On 
> RewriteCond %{HTTP_HOST} !^domain.com <http://domain.com> $ [NC]
> RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]
> 
> 
> On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com> wrote:
>> Thanks for the URL. I did not read this one, but a similar one also on the
>> site.
>> 
>> I did not blindly ask for suggestions without trying it first.
>> 
>> The issue I ran into was too many redirects. Clearly I didn't get it right
>> and hoped someone may have something worth trying.
>> 
>> Thanks
>> 
>> Steffan
>> 
>> 
>> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>> 
>>> 
>>> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com> wrote:
>>>> I am trying to figure out a specific rewrite.
>>>> 
>>>> I have a default host set up to catch any domains not served on the
>>>> specific server.
>>>> 
>>>> I am trying to direct unknown domains in a manner such as :
>>>> 
>>>> default domain would be domain.com <http://domain.com>
>>>> 
>>>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>>>> 
>>>> http://domain.com?domain=abc.com
>>>> 
>>>> or
>>>> 
>>>> http://domain.com/abc-com/
>>>> 
>>>> Any suggestions?
>>> 
>>> Yes, read the mod_rewrite page its all in there
>>> 
>>> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>>>  
>>>> 
>>>> 
>>>> Thanks
>>>> 
>>>> Steffan
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>> 
>>> 
> 



Re: [users@httpd] mod rewrite

Posted by Igor Cicimov <ic...@gmail.com>.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule .* http://domain.com?domain=%{HTTP_HOST} [R,L]


On Fri, Nov 9, 2012 at 1:05 PM, Steffan A. Cline <st...@hldns.com> wrote:

> Thanks for the URL. I did not read this one, but a similar one also on the
> site.
>
> I did not blindly ask for suggestions without trying it first.
>
> The issue I ran into was too many redirects. Clearly I didn't get it right
> and hoped someone may have something worth trying.
>
> Thanks
>
> Steffan
>
>
> On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:
>
>
> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com>wrote:
>
>> I am trying to figure out a specific rewrite.
>>
>> I have a default host set up to catch any domains not served on the
>> specific server.
>>
>> I am trying to direct unknown domains in a manner such as :
>>
>> default domain would be domain.com
>>
>> So, abc.com hits, it would be rewritten to
>>
>> http://domain.com?domain=abc.com
>>
>> or
>>
>> http://domain.com/abc-com/
>>
>> Any suggestions?
>>
>
> Yes, read the mod_rewrite page its all in there
>
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>
>
>>
>>
>> Thanks
>>
>> Steffan
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>

Re: [users@httpd] mod rewrite

Posted by "Steffan A. Cline" <st...@hldns.com>.
Thanks for the URL. I did not read this one, but a similar one also on the
site.

I did not blindly ask for suggestions without trying it first.

The issue I ran into was too many redirects. Clearly I didn't get it right
and hoped someone may have something worth trying.

Thanks

Steffan


On 11/8/12 6:32 PM, "Igor Cicimov" <ic...@gmail.com> wrote:

> 
> On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com> wrote:
>> I am trying to figure out a specific rewrite.
>> 
>> I have a default host set up to catch any domains not served on the
>> specific server.
>> 
>> I am trying to direct unknown domains in a manner such as :
>> 
>> default domain would be domain.com <http://domain.com>
>> 
>> So, abc.com <http://abc.com>  hits, it would be rewritten to
>> 
>> http://domain.com?domain=abc.com
>> 
>> or
>> 
>> http://domain.com/abc-com/
>> 
>> Any suggestions?
> 
> Yes, read the mod_rewrite page its all in there
> 
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
>  
>> 
>> 
>> Thanks
>> 
>> Steffan
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
> 



Re: [users@httpd] mod rewrite

Posted by Igor Cicimov <ic...@gmail.com>.
On Fri, Nov 9, 2012 at 9:59 AM, Steffan A. Cline <st...@hldns.com> wrote:

> I am trying to figure out a specific rewrite.
>
> I have a default host set up to catch any domains not served on the
> specific server.
>
> I am trying to direct unknown domains in a manner such as :
>
> default domain would be domain.com
>
> So, abc.com hits, it would be rewritten to
>
> http://domain.com?domain=abc.com
>
> or
>
> http://domain.com/abc-com/
>
> Any suggestions?
>

Yes, read the mod_rewrite page its all in there

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


>
>
> Thanks
>
> Steffan
>
> ---------------------------------------------------------------
> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
> Steffan A. Cline
> Steffan@ExecuChoice.net                             Phoenix, Az
> http://www.ExecuChoice.net                                  USA
> AIM    : SteffanC                     Skype : steffancline
> GOOGLE : Steffan.Cline@gmail.com        MSN : steffan@hldns.com
> YAHOO  : Steffan_Cline                  ICQ : 57234309
> ---------------------------------------------------------------
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>