URL rewite

mcnultyj111
mcnultyj111 used Ask the Experts™
on
Hi,

I have a URL http://pcli174:8079/zope/index which is quite an ugly URL so I have got a domain called libintranet.x.com which I want it to point to the folder http://pcli174:8079/zope/index.

Any ideas on how I can do this?

Thanks

James
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Place this into your virtual hosts configuration:

RewriteEngine On
RewriteLogLevel 0
RewriteRule   ^/(.*)$ http://pcli174:8079/zope/$1  [P,L]

This changes all URLs http://libintranet.x.com/abc to http://pcli174:8079/zope/abc.

Commented:
If you have no access to the webserver's configuration, you can use a frameset with one big frame. But then the URL is always the same...

Commented:
Postscriptum:

The rewrite from Cood uses Proxy forwarding, which is correct. If your zope server does redirection you may need proxy directives to do the same rewriting on return (see ProxyPassReverse in the Apache docu). This also necessitates the use of relative URLs, ie URLs which DON'T start with a forward slash.

It may be better to keep the zope directory in the URL and rewite as :-

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

this maps http://libintranet.x.com/zope/abc to http://pcli174:8079/zope/abc.

HTH

Commented:
James,

OR you can configure a VirtualHost for libintranet.x.com, and have it's DocumentRoot to point to where http://pcli174:8079/zope/ is located.

cheers.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial