Re: Rewrite Rule Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 20, 2008 at 10:56 PM, Scott Moseman <scmoseman@xxxxxxxxx> wrote:
> I'm trying to hide the /portal/ path for a website behind the scenes
> using mod_proxy.  I had to use the RewriteEngine because the website
> (not under rmy control) uses some absolute URL references in the code,
> and if I don't remove the /portal/ reference it obviously breaks the
> site.

Could yo ube more specific? Is the web application configured with /
as base URL or with /portal/ as base URL? Do you want to hide the
"/portal" path for your users, of for the web application?

>
> RewriteEngine On
> RewriteCond  %{REQUEST_URI}  ^/portal/(.*)
> RewriteRule  ^/portal/(.*)   /$1   [R]

The rewriteCond is superfluous. The rewriterule will only match urls
starting with /portal...

> That's what I originally came up with, and for static surfing it was
> working fine.  But I could never login.  I thought it was, perhaps, a
> bug since the packet capture showed the Apache server changing ports
> on the FIN ACK section of the TCP transactions.

You won't find this using packet capture, and since apache is not
involved in the TCP transaction (the OS does that) whatever happens
there is not going to be relevant.
You need to look at what happens at the application layer. Use a tool
like the LiveHTTPHeaders plugin for firefox.


> If I change the [R] to [P], I'm able to login, but it carries over the
> /portal/ path for the rest of the session.  We're trying to hide that.

There is a big difference between a redirect and a proxy. If you do a
redirect, you are not using mod_proxy at all. All you accomplish with
a redirect is you instruct the server to tell the webclients that
/portal/foo.html is really at /foo.html.
With a proxy what you are doing is giving the clients that request
/portal/foo.html the content at /foo.html in stead.

Now I am a bit confused by what you want to achieve. You tell us you
want to "hide" part of a URL. To the users? In that case you need to
proxy, not to redirect, as redirect _doesn't_ hide URLs.

You also tell us that your application works when you do a redirect,
that you can login.So is it that something like
http://foo.com/login.php works, always, and that you want users to be
able to also click on http://foo.com/portal/login.php?

Krist

-- 
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux