Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448
Rep:
apache rewrite help
I'm trying to proxy a server and change the appearance of the server directories for client browsers.
On the proxy server ("proxy"), I've added the following:
Code:
ReWriteEngine On
RewriteRule ^/dir/ect/ory/$ http://server/directory/ [R]
This works in general, but the browser displays proxy/directory/ instead of proxy/dir/ect/ory/, which is what I would like it to show (is that a transparent proxy?).
I've also had to write additional rules for subdirectories, which tells me I'm probably doing something wrong:
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448
Original Poster
Rep:
I think a very simple pair of ProxyPass|ProxyPassReverse directives could replace some of this stuff, but not all... what about this on the proxy server:
That seems to do exactly what I need as far as the client-side URL goes.
The problem is the subdirs: I'm doing this because I need to mirror TWiki pages (which are not .HTML files) with their HTML counterparts. The TWiki treats URL space a bit differently (their "webs" and "topics" appear as directories without a trailing slash in the URL). So when you browse to a specific page of the TWiki, you don't append .html to the URL because it doesn't exist. However, it's there on the HTML mirror, and I need something to not ony append the .html suffix to each incoming request, but to be able to tell whether the request is looking for a file or a directory.
The RewriteRule above works for that, if I duplicate it so it appears with and without the trailing slash, and for each subdirectory (I'm sure there's a better way... I can't figure out the syntax to condense it all). But that doesn't help with the URL space issue that ProxyPass seems to help with.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.