rename url

i have a rewrite rule

which redirects url  www.xyz.com   to www.abc.com/oos/outofservice.cgi

can i rename the url www.abc.com/oos/outofservice.cgi    to   www.xyz.com

so that is someone clicks refresh it should actualy request the page www.xyz.com  from server  and not    www.abc.com/oos/outofservice.cgi


how do i configure apache for this

LVL 1
shahrahulbAsked:
Who is Participating?
 
crackyCommented:
No, that would alias www.xyz.com/oos to the internal path /v/blah.com/ma/www/oos/oos.cgi, but leave www.xyz.com/oos in the address bar. To do the above, you would need:

Alias / /v/blah.com/ma/www/oos/oos.cgi

This would keep www.xyz.com in the address bar and load the local path /v/blah.com/ma/www/oos/oos.cgi
0
 
shahrahulbAuthor Commented:
on the address bar it should show www.xyz.com  but the actual page it is displaying should be  www.abc.com/oos/outofservice.cgi
0
 
shahrahulbAuthor Commented:
to be more precise:

 whenever apache requests anything from /v/blah.com/ma/www/oos

it should actualy request from there but on the url it should always show www.xyz.com

for example for the file /v/blah.com/ma/www/oos/oos.cgi
the url is http://www.blah.ma.com/oos/oos.cgi

but on the address bar i want to display www.xyz.com

is this possible

Thanks
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
crackyCommented:
You are looking for an alias:

http://httpd.apache.org/docs/mod/mod_alias.html#alias

So, your virtualhost file for www.xyz.com should have:

Alias /oos /v/blah.com/ma/www/oos/oos.cgi

Note that you probably want AliasMatch if you want to use regexp to match everything after the first /

AliasMatch ^/(.*)$ /v/blah.com/ma/www/$1
0
 
shahrahulbAuthor Commented:
u mean to say, if i write
Alias /oos /v/blah.com/ma/www/oos/oos.cgi

when i hit the url www.xyz.com  it will display http://www.blah.ma.com/oos/oos.cgi  but on the address bar it will show www.xyz.com

Right??
0
 
ahoffmannCommented:
in httpd.conf of www.abc.com:

RewriteEngine On
RewiteCond %{REQUEST_URI} ^/oos/outofservice.cgi
RewirteRule  ^(/oos/outofservice.cgi.*)  http://www.xyz.com/$1 [P,L]
0
 
mrielfCommented:
www.xyz.com and www.abc.com resides on same machine?

If not, then you must enable proxy module on www.xyz.com
and do redirect to abc.com with proxy...

(in conf file of www.xyz.com)

RewriteEngine On
RewriteRule / http://www.abc.com/oos/outofservice.cgi [P,L]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.