proxypass and mod_rewrite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

proxypass and mod_rewrite

lns_lns
Hi,
i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop ajp://localhost:8009/).
i would like to get rid of the "control" and the "~" in front of parameters. I'm trying to get the rewriterule to work, with no success and after searching everywhere i thought this might be tha place to post.
I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be rewritten to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm sure there's something very wrong with it:
"RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
Can someone please help me?
Thanks in advance.

Regards
Lukas
Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

BJ Freeman
the control is necessary when passing to ofbiz
so if you going from
/shop/main/p/site=1/p/user=1"
to
/control/main/uri of ecommerce
then it works
also note that parameters in the URI are not allow for https anymore
I believe the design change may effect http also.
not sure.




lns_lns sent the following on 5/16/2009 9:17 AM:

> Hi,
> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
> ajp://localhost:8009/).
> i would like to get rid of the "control" and the "~" in front of parameters.
> I'm trying to get the rewriterule to work, with no success and after
> searching everywhere i thought this might be tha place to post.
> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be rewritten
> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm sure
> there's something very wrong with it:
> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
> Can someone please help me?
> Thanks in advance.
>
> Regards
> Lukas

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.

Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

lns_lns
well, "shop" is not the ecommerce application, it is the "mount point" for the entire ofbiz, wich is running just one application , mounted to "/". i know the control is necessary, but shouldn't it be passed when added by url rewriting?
what do you mean not allowed anymore?
how do i have to pass parameters?
Thanks!
BJ Freeman wrote
the control is necessary when passing to ofbiz
so if you going from
/shop/main/p/site=1/p/user=1"
to
/control/main/uri of ecommerce
then it works
also note that parameters in the URI are not allow for https anymore
I believe the design change may effect http also.
not sure.




lns_lns sent the following on 5/16/2009 9:17 AM:
> Hi,
> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
> ajp://localhost:8009/).
> i would like to get rid of the "control" and the "~" in front of parameters.
> I'm trying to get the rewriterule to work, with no success and after
> searching everywhere i thought this might be tha place to post.
> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be rewritten
> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm sure
> there's something very wrong with it:
> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
> Can someone please help me?
> Thanks in advance.
>
> Regards
> Lukas

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.
Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

BJ Freeman
In reply to this post by BJ Freeman
(proxyPass /shop  ajp://localhost:8009/).
/shop is what apaches sees and yes passes it to /

so what ever you have mounted in ofbiz web.xml as / is what will receive
the URI

so then if you have on the apache side
/shop/Main the ofbiz side with not re-write will not know which
component to send it to.

even if you do say a /shop/catalog
you will have to do a rewrite to make it /catalog/control/main on the
ofbiz side.
and ofcourse once you do that then it will show in the URL.

there has been a lot of discussion on the dev list about tightening the
security. On the Https side on parameters are allowed thru the URL. they
must be in the session and passed as context or request
The happened about a month before 904 was released.


lns_lns sent the following on 5/16/2009 10:46 AM:

> well, "shop" is not the ecommerce application, it is the "mount point" for
> the entire ofbiz, wich is running just one application , mounted to "/". i
> know the control is necessary, but shouldn't it be passed when added by url
> rewriting?
> what do you mean not allowed anymore?
> how do i have to pass parameters?
> Thanks!
>
> BJ Freeman wrote:
>> the control is necessary when passing to ofbiz
>> so if you going from
>> /shop/main/p/site=1/p/user=1"
>> to
>> /control/main/uri of ecommerce
>> then it works
>> also note that parameters in the URI are not allow for https anymore
>> I believe the design change may effect http also.
>> not sure.
>>
>>
>>
>>
>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>> Hi,
>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>> ajp://localhost:8009/).
>>> i would like to get rid of the "control" and the "~" in front of
>>> parameters.
>>> I'm trying to get the rewriterule to work, with no success and after
>>> searching everywhere i thought this might be tha place to post.
>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>> rewritten
>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>> sure
>>> there's something very wrong with it:
>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>> Can someone please help me?
>>> Thanks in advance.
>>>
>>> Regards
>>> Lukas
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.

Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

lns_lns
ok, thanks!
is it possible to change "control" to "s" for example?
like so: "<url-pattern>/s/*</url-pattern>"
how do i send a request variable from ftl to bsh?
what about hrefs?
Thank you so much for your help


BJ Freeman wrote
(proxyPass /shop  ajp://localhost:8009/).
/shop is what apaches sees and yes passes it to /

so what ever you have mounted in ofbiz web.xml as / is what will receive
the URI

so then if you have on the apache side
/shop/Main the ofbiz side with not re-write will not know which
component to send it to.

even if you do say a /shop/catalog
you will have to do a rewrite to make it /catalog/control/main on the
ofbiz side.
and ofcourse once you do that then it will show in the URL.

there has been a lot of discussion on the dev list about tightening the
security. On the Https side on parameters are allowed thru the URL. they
must be in the session and passed as context or request
The happened about a month before 904 was released.


lns_lns sent the following on 5/16/2009 10:46 AM:
> well, "shop" is not the ecommerce application, it is the "mount point" for
> the entire ofbiz, wich is running just one application , mounted to "/". i
> know the control is necessary, but shouldn't it be passed when added by url
> rewriting?
> what do you mean not allowed anymore?
> how do i have to pass parameters?
> Thanks!
>
> BJ Freeman wrote:
>> the control is necessary when passing to ofbiz
>> so if you going from
>> /shop/main/p/site=1/p/user=1"
>> to
>> /control/main/uri of ecommerce
>> then it works
>> also note that parameters in the URI are not allow for https anymore
>> I believe the design change may effect http also.
>> not sure.
>>
>>
>>
>>
>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>> Hi,
>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>> ajp://localhost:8009/).
>>> i would like to get rid of the "control" and the "~" in front of
>>> parameters.
>>> I'm trying to get the rewriterule to work, with no success and after
>>> searching everywhere i thought this might be tha place to post.
>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>> rewritten
>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>> sure
>>> there's something very wrong with it:
>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>> Can someone please help me?
>>> Thanks in advance.
>>>
>>> Regards
>>> Lukas
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.
Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

lns_lns
In reply to this post by BJ Freeman
the rewrite you mentioned is exactly what I want to accomplish with mod_rewrite, but I don't know how.
Isn't the purpose of a url rewrite to send something different to the server than typed in the addressbar?
Basically i have to send at least one parameter in the url, the detail page of the product should look like:
browser: "/shop/product/"+productname+""
server:   "/control/product/~name="+productname+""
thanks again.

BJ Freeman wrote
(proxyPass /shop  ajp://localhost:8009/).
/shop is what apaches sees and yes passes it to /

so what ever you have mounted in ofbiz web.xml as / is what will receive
the URI

so then if you have on the apache side
/shop/Main the ofbiz side with not re-write will not know which
component to send it to.

even if you do say a /shop/catalog
you will have to do a rewrite to make it /catalog/control/main on the
ofbiz side.
and ofcourse once you do that then it will show in the URL.

there has been a lot of discussion on the dev list about tightening the
security. On the Https side on parameters are allowed thru the URL. they
must be in the session and passed as context or request
The happened about a month before 904 was released.


lns_lns sent the following on 5/16/2009 10:46 AM:
> well, "shop" is not the ecommerce application, it is the "mount point" for
> the entire ofbiz, wich is running just one application , mounted to "/". i
> know the control is necessary, but shouldn't it be passed when added by url
> rewriting?
> what do you mean not allowed anymore?
> how do i have to pass parameters?
> Thanks!
>
> BJ Freeman wrote:
>> the control is necessary when passing to ofbiz
>> so if you going from
>> /shop/main/p/site=1/p/user=1"
>> to
>> /control/main/uri of ecommerce
>> then it works
>> also note that parameters in the URI are not allow for https anymore
>> I believe the design change may effect http also.
>> not sure.
>>
>>
>>
>>
>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>> Hi,
>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>> ajp://localhost:8009/).
>>> i would like to get rid of the "control" and the "~" in front of
>>> parameters.
>>> I'm trying to get the rewriterule to work, with no success and after
>>> searching everywhere i thought this might be tha place to post.
>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>> rewritten
>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>> sure
>>> there's something very wrong with it:
>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>> Can someone please help me?
>>> Thanks in advance.
>>>
>>> Regards
>>> Lukas
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.
Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

rajsaini
In reply to this post by lns_lns
Lukas,

It is possible to rewrite the URLs the way you want using Apache
mod_rewrite. http://www.louielighting.com/ is one example. However, url
rewrite is not really easy to do. Since OFBiz urls also include host
name as part of URL it is not possible to rewrite them with simple
proxyPass and ReverseProxyPass directives. Along with mod_rewirte you
may also need mod_proxy_html to rewrite the links within a page. Try
this link http://apache.webthing.com/mod_proxy_html/ for mod_proxy_html.



Thanks,

Raj



lns_lns wrote:

> ok, thanks!
> is it possible to change "control" to "s" for example?
> like so: "<url-pattern>/s/*</url-pattern>"
> how do i send a request variable from ftl to bsh?
> what about hrefs?
> Thank you so much for your help
>
>
>
> BJ Freeman wrote:
>  
>> (proxyPass /shop  ajp://localhost:8009/).
>> /shop is what apaches sees and yes passes it to /
>>
>> so what ever you have mounted in ofbiz web.xml as / is what will receive
>> the URI
>>
>> so then if you have on the apache side
>> /shop/Main the ofbiz side with not re-write will not know which
>> component to send it to.
>>
>> even if you do say a /shop/catalog
>> you will have to do a rewrite to make it /catalog/control/main on the
>> ofbiz side.
>> and ofcourse once you do that then it will show in the URL.
>>
>> there has been a lot of discussion on the dev list about tightening the
>> security. On the Https side on parameters are allowed thru the URL. they
>> must be in the session and passed as context or request
>> The happened about a month before 904 was released.
>>
>>
>> lns_lns sent the following on 5/16/2009 10:46 AM:
>>    
>>> well, "shop" is not the ecommerce application, it is the "mount point"
>>> for
>>> the entire ofbiz, wich is running just one application , mounted to "/".
>>> i
>>> know the control is necessary, but shouldn't it be passed when added by
>>> url
>>> rewriting?
>>> what do you mean not allowed anymore?
>>> how do i have to pass parameters?
>>> Thanks!
>>>
>>> BJ Freeman wrote:
>>>      
>>>> the control is necessary when passing to ofbiz
>>>> so if you going from
>>>> /shop/main/p/site=1/p/user=1"
>>>> to
>>>> /control/main/uri of ecommerce
>>>> then it works
>>>> also note that parameters in the URI are not allow for https anymore
>>>> I believe the design change may effect http also.
>>>> not sure.
>>>>
>>>>
>>>>
>>>>
>>>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>>>        
>>>>> Hi,
>>>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>>>> ajp://localhost:8009/).
>>>>> i would like to get rid of the "control" and the "~" in front of
>>>>> parameters.
>>>>> I'm trying to get the rewriterule to work, with no success and after
>>>>> searching everywhere i thought this might be tha place to post.
>>>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>>>> rewritten
>>>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>>>> sure
>>>>> there's something very wrong with it:
>>>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>>>> Can someone please help me?
>>>>> Thanks in advance.
>>>>>
>>>>> Regards
>>>>> Lukas
>>>>>          
>>>> --
>>>> BJ Freeman
>>>> http://www.businessesnetwork.com/automation
>>>> http://bjfreeman.elance.com
>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>> Systems Integrator.
>>>>
>>>>
>>>>
>>>>        
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

lns_lns
Hi Raj,
how about tuckeys urlrewriter?
i tried it earlier, but it added an adittional slash to my urls,
so basically i go to "/shop/main" and tuckey made "//control/main". what would be perfect, just the extra slash is causing a null pointer exception, do you  know how to get rid of that?
here's my tuckey rule, note the extra / in the rule that converts home to main is neccesary, so the other rule kicks in:
<rule>
            <from>^/[a-z]*/home$</from>
            <to type="forward">//main</to>
    </rule>
        <rule>
            <from>^/(.+)$</from>
            <to type="forward">/control$1</to>
    </rule>
About mod_rewrite: it appears to me as if the mod_rewrite is done after the mod_proxy. it works if i add the full path "http://192.168.1.123/shop/control/$1" , but then ofcourse it appears in the addressbar.
if i just add "/control/$1" i get 404 from apache, not tomcat. it seems like those 2 mods where not meant to be work together...
Thanks!

Regards
Lukas

Raj Saini wrote
Lukas,

It is possible to rewrite the URLs the way you want using Apache
mod_rewrite. http://www.louielighting.com/ is one example. However, url
rewrite is not really easy to do. Since OFBiz urls also include host
name as part of URL it is not possible to rewrite them with simple
proxyPass and ReverseProxyPass directives. Along with mod_rewirte you
may also need mod_proxy_html to rewrite the links within a page. Try
this link http://apache.webthing.com/mod_proxy_html/ for mod_proxy_html.



Thanks,

Raj



lns_lns wrote:
> ok, thanks!
> is it possible to change "control" to "s" for example?
> like so: "<url-pattern>/s/*</url-pattern>"
> how do i send a request variable from ftl to bsh?
> what about hrefs?
> Thank you so much for your help
>
>
>
> BJ Freeman wrote:
>  
>> (proxyPass /shop  ajp://localhost:8009/).
>> /shop is what apaches sees and yes passes it to /
>>
>> so what ever you have mounted in ofbiz web.xml as / is what will receive
>> the URI
>>
>> so then if you have on the apache side
>> /shop/Main the ofbiz side with not re-write will not know which
>> component to send it to.
>>
>> even if you do say a /shop/catalog
>> you will have to do a rewrite to make it /catalog/control/main on the
>> ofbiz side.
>> and ofcourse once you do that then it will show in the URL.
>>
>> there has been a lot of discussion on the dev list about tightening the
>> security. On the Https side on parameters are allowed thru the URL. they
>> must be in the session and passed as context or request
>> The happened about a month before 904 was released.
>>
>>
>> lns_lns sent the following on 5/16/2009 10:46 AM:
>>    
>>> well, "shop" is not the ecommerce application, it is the "mount point"
>>> for
>>> the entire ofbiz, wich is running just one application , mounted to "/".
>>> i
>>> know the control is necessary, but shouldn't it be passed when added by
>>> url
>>> rewriting?
>>> what do you mean not allowed anymore?
>>> how do i have to pass parameters?
>>> Thanks!
>>>
>>> BJ Freeman wrote:
>>>      
>>>> the control is necessary when passing to ofbiz
>>>> so if you going from
>>>> /shop/main/p/site=1/p/user=1"
>>>> to
>>>> /control/main/uri of ecommerce
>>>> then it works
>>>> also note that parameters in the URI are not allow for https anymore
>>>> I believe the design change may effect http also.
>>>> not sure.
>>>>
>>>>
>>>>
>>>>
>>>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>>>        
>>>>> Hi,
>>>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>>>> ajp://localhost:8009/).
>>>>> i would like to get rid of the "control" and the "~" in front of
>>>>> parameters.
>>>>> I'm trying to get the rewriterule to work, with no success and after
>>>>> searching everywhere i thought this might be tha place to post.
>>>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>>>> rewritten
>>>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>>>> sure
>>>>> there's something very wrong with it:
>>>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>>>> Can someone please help me?
>>>>> Thanks in advance.
>>>>>
>>>>> Regards
>>>>> Lukas
>>>>>          
>>>> --
>>>> BJ Freeman
>>>> http://www.businessesnetwork.com/automation
>>>> http://bjfreeman.elance.com
>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>> Systems Integrator.
>>>>
>>>>
>>>>
>>>>        
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>>    
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

rajsaini
Hi Lucas,

I have no idea about "uckeys urlrewriter".

Regarding mod_rewrite it can work with mod_proxy. Just don't use the
ProxyPass, instead use the [P] qualifier to rewrite rule.

Thanks,

Raj

uckeys urlrewriter

lns_lns wrote:

> Hi Raj,
> how about tuckeys urlrewriter?
> i tried it earlier, but it added an adittional slash to my urls,
> so basically i go to "/shop/main" and tuckey made "//control/main". what
> would be perfect, just the extra slash is causing a null pointer exception,
> do you  know how to get rid of that?
> here's my tuckey rule, note the extra / in the rule that converts home to
> main is neccesary, so the other rule kicks in:
> <rule>
>             <from>^/[a-z]*/home$</from>
>             <to type="forward">//main</to>
>     </rule>
> <rule>
>             <from>^/(.+)$</from>
>             <to type="forward">/control$1</to>
>     </rule>
> About mod_rewrite: it appears to me as if the mod_rewrite is done after the
> mod_proxy. it works if i add the full path
> "http://192.168.1.123/shop/control/$1" , but then ofcourse it appears in the
> addressbar.
> if i just add "/control/$1" i get 404 from apache, not tomcat. it seems like
> those 2 mods where not meant to be work together...
> Thanks!
>
> Regards
> Lukas
>
>
> Raj Saini wrote:
>  
>> Lukas,
>>
>> It is possible to rewrite the URLs the way you want using Apache
>> mod_rewrite. http://www.louielighting.com/ is one example. However, url
>> rewrite is not really easy to do. Since OFBiz urls also include host
>> name as part of URL it is not possible to rewrite them with simple
>> proxyPass and ReverseProxyPass directives. Along with mod_rewirte you
>> may also need mod_proxy_html to rewrite the links within a page. Try
>> this link http://apache.webthing.com/mod_proxy_html/ for mod_proxy_html.
>>
>>
>>
>> Thanks,
>>
>> Raj
>>
>>
>>
>> lns_lns wrote:
>>    
>>> ok, thanks!
>>> is it possible to change "control" to "s" for example?
>>> like so: "<url-pattern>/s/*</url-pattern>"
>>> how do i send a request variable from ftl to bsh?
>>> what about hrefs?
>>> Thank you so much for your help
>>>
>>>
>>>
>>> BJ Freeman wrote:
>>>  
>>>      
>>>> (proxyPass /shop  ajp://localhost:8009/).
>>>> /shop is what apaches sees and yes passes it to /
>>>>
>>>> so what ever you have mounted in ofbiz web.xml as / is what will receive
>>>> the URI
>>>>
>>>> so then if you have on the apache side
>>>> /shop/Main the ofbiz side with not re-write will not know which
>>>> component to send it to.
>>>>
>>>> even if you do say a /shop/catalog
>>>> you will have to do a rewrite to make it /catalog/control/main on the
>>>> ofbiz side.
>>>> and ofcourse once you do that then it will show in the URL.
>>>>
>>>> there has been a lot of discussion on the dev list about tightening the
>>>> security. On the Https side on parameters are allowed thru the URL. they
>>>> must be in the session and passed as context or request
>>>> The happened about a month before 904 was released.
>>>>
>>>>
>>>> lns_lns sent the following on 5/16/2009 10:46 AM:
>>>>    
>>>>        
>>>>> well, "shop" is not the ecommerce application, it is the "mount point"
>>>>> for
>>>>> the entire ofbiz, wich is running just one application , mounted to
>>>>> "/".
>>>>> i
>>>>> know the control is necessary, but shouldn't it be passed when added by
>>>>> url
>>>>> rewriting?
>>>>> what do you mean not allowed anymore?
>>>>> how do i have to pass parameters?
>>>>> Thanks!
>>>>>
>>>>> BJ Freeman wrote:
>>>>>      
>>>>>          
>>>>>> the control is necessary when passing to ofbiz
>>>>>> so if you going from
>>>>>> /shop/main/p/site=1/p/user=1"
>>>>>> to
>>>>>> /control/main/uri of ecommerce
>>>>>> then it works
>>>>>> also note that parameters in the URI are not allow for https anymore
>>>>>> I believe the design change may effect http also.
>>>>>> not sure.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>>>>>        
>>>>>>            
>>>>>>> Hi,
>>>>>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass
>>>>>>> /shop
>>>>>>> ajp://localhost:8009/).
>>>>>>> i would like to get rid of the "control" and the "~" in front of
>>>>>>> parameters.
>>>>>>> I'm trying to get the rewriterule to work, with no success and after
>>>>>>> searching everywhere i thought this might be tha place to post.
>>>>>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>>>>>> rewritten
>>>>>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>>>>>> sure
>>>>>>> there's something very wrong with it:
>>>>>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>>>>>> Can someone please help me?
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>> Regards
>>>>>>> Lukas
>>>>>>>          
>>>>>>>              
>>>>>> --
>>>>>> BJ Freeman
>>>>>> http://www.businessesnetwork.com/automation
>>>>>> http://bjfreeman.elance.com
>>>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>>>> Systems Integrator.
>>>>>>
>>>>>>
>>>>>>
>>>>>>        
>>>>>>            
>>>> --
>>>> BJ Freeman
>>>> http://www.businessesnetwork.com/automation
>>>> http://bjfreeman.elance.com
>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>> Systems Integrator.
>>>>
>>>>
>>>>
>>>>    
>>>>        
>>>  
>>>      
>>
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

lns_lns
Thanks, i'll play arround with it for a while, even though I'll try to get tuckeys to work as well...

Raj Saini wrote
Hi Lucas,

I have no idea about "uckeys urlrewriter".

Regarding mod_rewrite it can work with mod_proxy. Just don't use the
ProxyPass, instead use the [P] qualifier to rewrite rule.

Thanks,

Raj

uckeys urlrewriter

lns_lns wrote:
> Hi Raj,
> how about tuckeys urlrewriter?
> i tried it earlier, but it added an adittional slash to my urls,
> so basically i go to "/shop/main" and tuckey made "//control/main". what
> would be perfect, just the extra slash is causing a null pointer exception,
> do you  know how to get rid of that?
> here's my tuckey rule, note the extra / in the rule that converts home to
> main is neccesary, so the other rule kicks in:
> <rule>
>             <from>^/[a-z]*/home$</from>
>             <to type="forward">//main</to>
>     </rule>
> <rule>
>             <from>^/(.+)$</from>
>             <to type="forward">/control$1</to>
>     </rule>
> About mod_rewrite: it appears to me as if the mod_rewrite is done after the
> mod_proxy. it works if i add the full path
> "http://192.168.1.123/shop/control/$1" , but then ofcourse it appears in the
> addressbar.
> if i just add "/control/$1" i get 404 from apache, not tomcat. it seems like
> those 2 mods where not meant to be work together...
> Thanks!
>
> Regards
> Lukas
>
>
> Raj Saini wrote:
>  
>> Lukas,
>>
>> It is possible to rewrite the URLs the way you want using Apache
>> mod_rewrite. http://www.louielighting.com/ is one example. However, url
>> rewrite is not really easy to do. Since OFBiz urls also include host
>> name as part of URL it is not possible to rewrite them with simple
>> proxyPass and ReverseProxyPass directives. Along with mod_rewirte you
>> may also need mod_proxy_html to rewrite the links within a page. Try
>> this link http://apache.webthing.com/mod_proxy_html/ for mod_proxy_html.
>>
>>
>>
>> Thanks,
>>
>> Raj
>>
>>
>>
>> lns_lns wrote:
>>    
>>> ok, thanks!
>>> is it possible to change "control" to "s" for example?
>>> like so: "<url-pattern>/s/*</url-pattern>"
>>> how do i send a request variable from ftl to bsh?
>>> what about hrefs?
>>> Thank you so much for your help
>>>
>>>
>>>
>>> BJ Freeman wrote:
>>>  
>>>      
>>>> (proxyPass /shop  ajp://localhost:8009/).
>>>> /shop is what apaches sees and yes passes it to /
>>>>
>>>> so what ever you have mounted in ofbiz web.xml as / is what will receive
>>>> the URI
>>>>
>>>> so then if you have on the apache side
>>>> /shop/Main the ofbiz side with not re-write will not know which
>>>> component to send it to.
>>>>
>>>> even if you do say a /shop/catalog
>>>> you will have to do a rewrite to make it /catalog/control/main on the
>>>> ofbiz side.
>>>> and ofcourse once you do that then it will show in the URL.
>>>>
>>>> there has been a lot of discussion on the dev list about tightening the
>>>> security. On the Https side on parameters are allowed thru the URL. they
>>>> must be in the session and passed as context or request
>>>> The happened about a month before 904 was released.
>>>>
>>>>
>>>> lns_lns sent the following on 5/16/2009 10:46 AM:
>>>>    
>>>>        
>>>>> well, "shop" is not the ecommerce application, it is the "mount point"
>>>>> for
>>>>> the entire ofbiz, wich is running just one application , mounted to
>>>>> "/".
>>>>> i
>>>>> know the control is necessary, but shouldn't it be passed when added by
>>>>> url
>>>>> rewriting?
>>>>> what do you mean not allowed anymore?
>>>>> how do i have to pass parameters?
>>>>> Thanks!
>>>>>
>>>>> BJ Freeman wrote:
>>>>>      
>>>>>          
>>>>>> the control is necessary when passing to ofbiz
>>>>>> so if you going from
>>>>>> /shop/main/p/site=1/p/user=1"
>>>>>> to
>>>>>> /control/main/uri of ecommerce
>>>>>> then it works
>>>>>> also note that parameters in the URI are not allow for https anymore
>>>>>> I believe the design change may effect http also.
>>>>>> not sure.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>>>>>        
>>>>>>            
>>>>>>> Hi,
>>>>>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass
>>>>>>> /shop
>>>>>>> ajp://localhost:8009/).
>>>>>>> i would like to get rid of the "control" and the "~" in front of
>>>>>>> parameters.
>>>>>>> I'm trying to get the rewriterule to work, with no success and after
>>>>>>> searching everywhere i thought this might be tha place to post.
>>>>>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>>>>>> rewritten
>>>>>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>>>>>> sure
>>>>>>> there's something very wrong with it:
>>>>>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>>>>>> Can someone please help me?
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>> Regards
>>>>>>> Lukas
>>>>>>>          
>>>>>>>              
>>>>>> --
>>>>>> BJ Freeman
>>>>>> http://www.businessesnetwork.com/automation
>>>>>> http://bjfreeman.elance.com
>>>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>>>> Systems Integrator.
>>>>>>
>>>>>>
>>>>>>
>>>>>>        
>>>>>>            
>>>> --
>>>> BJ Freeman
>>>> http://www.businessesnetwork.com/automation
>>>> http://bjfreeman.elance.com
>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>> Systems Integrator.
>>>>
>>>>
>>>>
>>>>    
>>>>        
>>>  
>>>      
>>
>>    
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

BJ Freeman
In reply to this post by BJ Freeman
to change control to s is feasible, but not plausible if you want to be
able to get revisions for 904.
Also you much have the component name before the control.
the FTL handler looks for a groovy file (we stop using bsh) of the same
name, it then executes the groovy file then passes that data to the FTL.

lns_lns sent the following on 5/16/2009 11:59 AM:

> ok, thanks!
> is it possible to change "control" to "s" for example?
> like so: "<url-pattern>/s/*</url-pattern>"
> how do i send a request variable from ftl to bsh?
> what about hrefs?
> Thank you so much for your help
>
>
>
> BJ Freeman wrote:
>> (proxyPass /shop  ajp://localhost:8009/).
>> /shop is what apaches sees and yes passes it to /
>>
>> so what ever you have mounted in ofbiz web.xml as / is what will receive
>> the URI
>>
>> so then if you have on the apache side
>> /shop/Main the ofbiz side with not re-write will not know which
>> component to send it to.
>>
>> even if you do say a /shop/catalog
>> you will have to do a rewrite to make it /catalog/control/main on the
>> ofbiz side.
>> and ofcourse once you do that then it will show in the URL.
>>
>> there has been a lot of discussion on the dev list about tightening the
>> security. On the Https side on parameters are allowed thru the URL. they
>> must be in the session and passed as context or request
>> The happened about a month before 904 was released.
>>
>>
>> lns_lns sent the following on 5/16/2009 10:46 AM:
>>> well, "shop" is not the ecommerce application, it is the "mount point"
>>> for
>>> the entire ofbiz, wich is running just one application , mounted to "/".
>>> i
>>> know the control is necessary, but shouldn't it be passed when added by
>>> url
>>> rewriting?
>>> what do you mean not allowed anymore?
>>> how do i have to pass parameters?
>>> Thanks!
>>>
>>> BJ Freeman wrote:
>>>> the control is necessary when passing to ofbiz
>>>> so if you going from
>>>> /shop/main/p/site=1/p/user=1"
>>>> to
>>>> /control/main/uri of ecommerce
>>>> then it works
>>>> also note that parameters in the URI are not allow for https anymore
>>>> I believe the design change may effect http also.
>>>> not sure.
>>>>
>>>>
>>>>
>>>>
>>>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>>>> Hi,
>>>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>>>> ajp://localhost:8009/).
>>>>> i would like to get rid of the "control" and the "~" in front of
>>>>> parameters.
>>>>> I'm trying to get the rewriterule to work, with no success and after
>>>>> searching everywhere i thought this might be tha place to post.
>>>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>>>> rewritten
>>>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>>>> sure
>>>>> there's something very wrong with it:
>>>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>>>> Can someone please help me?
>>>>> Thanks in advance.
>>>>>
>>>>> Regards
>>>>> Lukas
>>>> --
>>>> BJ Freeman
>>>> http://www.businessesnetwork.com/automation
>>>> http://bjfreeman.elance.com
>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>> Systems Integrator.
>>>>
>>>>
>>>>
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.

Reply | Threaded
Open this post in threaded view
|

Re: proxypass and mod_rewrite

BJ Freeman
In reply to this post by BJ Freeman
You would use a Post to pass parms.
you would then need to write a groovy, or usd an event, or create a view
using a widget.


lns_lns sent the following on 5/16/2009 12:08 PM:

> the rewrite you mentioned is exactly what I want to accomplish with
> mod_rewrite, but I don't know how.
> Isn't the purpose of a url rewrite to send something different to the server
> than typed in the addressbar?
> Basically i have to send at least one parameter in the url, the detail page
> of the product should look like:
> browser: "/shop/product/"+productname+""
> server:   "/control/product/~name="+productname+""
> thanks again.
>
>
> BJ Freeman wrote:
>> (proxyPass /shop  ajp://localhost:8009/).
>> /shop is what apaches sees and yes passes it to /
>>
>> so what ever you have mounted in ofbiz web.xml as / is what will receive
>> the URI
>>
>> so then if you have on the apache side
>> /shop/Main the ofbiz side with not re-write will not know which
>> component to send it to.
>>
>> even if you do say a /shop/catalog
>> you will have to do a rewrite to make it /catalog/control/main on the
>> ofbiz side.
>> and ofcourse once you do that then it will show in the URL.
>>
>> there has been a lot of discussion on the dev list about tightening the
>> security. On the Https side on parameters are allowed thru the URL. they
>> must be in the session and passed as context or request
>> The happened about a month before 904 was released.
>>
>>
>> lns_lns sent the following on 5/16/2009 10:46 AM:
>>> well, "shop" is not the ecommerce application, it is the "mount point"
>>> for
>>> the entire ofbiz, wich is running just one application , mounted to "/".
>>> i
>>> know the control is necessary, but shouldn't it be passed when added by
>>> url
>>> rewriting?
>>> what do you mean not allowed anymore?
>>> how do i have to pass parameters?
>>> Thanks!
>>>
>>> BJ Freeman wrote:
>>>> the control is necessary when passing to ofbiz
>>>> so if you going from
>>>> /shop/main/p/site=1/p/user=1"
>>>> to
>>>> /control/main/uri of ecommerce
>>>> then it works
>>>> also note that parameters in the URI are not allow for https anymore
>>>> I believe the design change may effect http also.
>>>> not sure.
>>>>
>>>>
>>>>
>>>>
>>>> lns_lns sent the following on 5/16/2009 9:17 AM:
>>>>> Hi,
>>>>> i've got ofbiz 9 behind apache 2.2.9 using a proxpass (proxyPass /shop
>>>>> ajp://localhost:8009/).
>>>>> i would like to get rid of the "control" and the "~" in front of
>>>>> parameters.
>>>>> I'm trying to get the rewriterule to work, with no success and after
>>>>> searching everywhere i thought this might be tha place to post.
>>>>> I want the entered url e.g. "/shop/main/p/site=1/p/user=1" to be
>>>>> rewritten
>>>>> to "/shop/control/main/~site=1/~user=1". This is my approach, but I'm
>>>>> sure
>>>>> there's something very wrong with it:
>>>>> "RewriteRule ^/shop/(.+)/p/(.+) /shop/control/$1/~$2"
>>>>> Can someone please help me?
>>>>> Thanks in advance.
>>>>>
>>>>> Regards
>>>>> Lukas
>>>> --
>>>> BJ Freeman
>>>> http://www.businessesnetwork.com/automation
>>>> http://bjfreeman.elance.com
>>>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>>>> Systems Integrator.
>>>>
>>>>
>>>>
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.