Re: java app URL rewrite

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

 



Stauffer, Robert G wrote:
OK, that makes sense that PT wouldn't apply and that the rewrite engine
won't reprocess the URL.

Hmmmmmmm.  I did a poor job of explaining what I'm trying to do.
Basically I'm trying to hide the "jahia/Jahia" portion of the URL.  That
means there are three cases that need to be handled:

1) If the incoming URL is http://portal-dev:81/, it needs to be directed
to the home page which is
http://portal-dev:81/jahia/Jahia/site/jazzd/pid/9.  But the outgoing URL
displayed in the user's browser needs to be
http://portal-dev:81/site/jazzd/pid/9.
Or
2) If the incoming URL is something like
http://portal-dev:81/jahia/Jahia/site/jazzd/pid/31, it needs to be
directed to http://portal-dev:81/jahia/Jahia/site/jazzd/pid/31.  But the
outgoing URL display in the user's browser needs to be
http://portal-dev:81/site/jazzd/pid/31.
Or
3) If the incoming URL is something like
http://portal-dev:81/site/jazzd/pid/17, it needs to be directed to
http://portal-dev:81/jahia/Jahia/site/jazzd/pid/17.  But the outgoing
URL display in the user's browser needs to be
http://portal-dev:81/site/jazzd/pid/17.


Just sticking to case 1) for now, the following redirects
http://portal-dev:81/ to
http://portal-dev:81/jahia/Jahia/site/jazzd/pid/9.  But the outgoing URL
displayed in the user's browser is
http://portal-dev:81/jahia/Jahia/site/jazzd/pid/9, not
http://portal-dev:81/site/jazzd/pid/9.  How do I modify the following to
redirect to the right place and not show "jahia/Jahia" portion in the
users browser?

<VirtualHost portal-dev.dande.com:81>
  RewriteEngine On
  RewriteLogLevel 3
  RewriteLog logs/rewrite_port81.log
  RewriteRule ^/$ jahia/Jahia/site/jazzd/pid/9 [R,L]
</VirtualHost>

Ahhh, I see now. Much clearer. You're looking for something like this.

RewriteRule ^/jahia/Jahia/(.*)$ /$1 [R,L]
RewriteRule ^/site/jazzd/(.*)$ /jahia/Jahia/site/jazzd/$1 [L]
RewriteRule ^/$ /jahia/Jahia/site/jazzd/pid/9 [L]


The first rule performs the forced redirect to get "/jahia/Jahia" out of the URL. The second rule performs the internal rewrite to make it match the real page you want to load.
The third rule catches the request to the root directory.

You might need/want to tweak the second rule on how much of the URL it matches for the rewrite, since I don't know whether things under "/site" that are not under "/site/jazzd" should be redirected.

--
Justin Pasher

---------------------------------------------------------------------
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