Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Proxy setting strips CSS and Javascript

1 view
Skip to first unread message
Message has been deleted

HansH

unread,
Apr 2, 2008, 4:41:35 PM4/2/08
to
<soupo...@gmail.com> schreef in bericht
news:94bb9835-0321-4816...@x41g2000hsb.googlegroups.com...
>I have another issue with Apache. When I use it as a proxy, the page
> is stripped off the CSS and javascript.
>
> Here is the rule I use:
>
> RewriteCond %{REQUEST_URI} survey08app
> RewriteCond %{REQUEST_URI} !(userAdmin)
> RewriteRule ^.*$ http://192.168.5.10/survey08app/loginForm.htm [L,P]
>
> If I take out the P for Proxy, everything looks fine sans the URL. I
> used P in the first place to not show the IP address 192.168.5.10.
>
> There is something basic that I am missing. Your kind help is
> appreciated.
Rather than rewriterules try mod_proxy and freinds (assuming version 2.2)
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

HansH


sean dreilinger

unread,
Apr 2, 2008, 10:43:08 PM4/2/08
to soupo...@gmail.com
soupo...@gmail.com wrote:
> I have another issue with Apache. When I use it as a proxy, the page
> is stripped off the CSS and javascript.
>
> Here is the rule I use:
>
> RewriteCond %{REQUEST_URI} survey08app
> RewriteCond %{REQUEST_URI} !(userAdmin)
> RewriteRule ^.*$ http://192.168.5.10/survey08app/loginForm.htm [L,P]
>
> If I take out the P for Proxy, everything looks fine sans the URL. I
> used P in the first place to not show the IP address 192.168.5.10.

if you're proxying a page hosted on 192.168.5.10 that instructs the browser to
load additional files (such as cascading stylesheets and javascript) that are
also hosted on 192.168.5.10, then you either need to proxy those additional
assets, or move them onto a publicly-accessible web server and rewrite the web
content to point at their new public location.

if http://192.168.5.10/survey08app/loginForm.htm contains instructions like
<link rel=css href=/survey08app/loginForm.css> and <script
src=/survey08app/loginForm.js> -- the web browser is going to request those from
your public server, and you'll need to host them publicly or proxy those files
as well.

you might try something lazy and just proxy everything that falls under a
certain directory, along the lines of:

RewriteRule ^/survey08app/(.*)$ http://192.168.5.10/survey08app/$1 [L,P]

so if your user's browser requests any of

/survey08app/loginform.php
/survey08app/loginform.css
/survey08app/someotherfile.etc.etc

those are proxied from

http://192.168.5.10/survey08app/loginform.php
http://192.168.5.10/survey08app/loginform.css
http://192.168.5.10/survey08app/someotherfile.etc.etc

respectively.

--sean

--
sean dreilinger - http://durak.org/sean/

Message has been deleted

HansH

unread,
Apr 3, 2008, 9:44:04 AM4/3/08
to
<soupo...@gmail.com> schreef in bericht
news:14725e19-7051-4743...@c65g2000hsa.googlegroups.com...
On Apr 2, 10:43 pm, sean dreilinger <sean-use...@durak.org> wrote:
> The website in question has a login form. The user enters the email id
> and if valid the next form is shown. For some reason, upon submission
> of the form the IP address is shown. Whereas if I try the second page
> with proxy in the URL, it works.
>
> Let me try to illustrate this as follows:
>
> http://proxy/survey08app/loginForm.htm ---> shows up correctly
>
> Fill the form and expect http://proxy/survey08app/page2.htm
> but instead I get http://192.168.5.10/survey08app/page2.htm
>
> However, if I try http://proxy/survey08/page2.htm it shows up
> correctly and I am able to complete the survey with proxy settings.
>
> There is nothing special about page2 to prevent the proxy settings.
Check for missing or ampty action atribute at th <form ... > tag.
Check for JavaScript interfering the submit.


Just 2ct ...

HansH


Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages