Operating System - HP-UX
1833452 Members
3331 Online
110052 Solutions
New Discussion

Re: redirecting url to a different url

 
SOLVED
Go to solution

redirecting url to a different url

I need to redirect the following:


http://sample.domain to

http://new.sample.domain:7777/forms90/f90servlet?config=sampletrng.

I am using hpux 11.11, the latest version of apache from hp. I already have a webserver running at port 80 however I need to leave that webserver in place. What is the best way of going about this? Virtual Hosting directives? Does any one have any good examples of making the change I require.


Thanks.
7 REPLIES 7
Florian Heigl (new acc)
Honored Contributor
Solution

Re: redirecting url to a different url

mod_rewrite - much more flexible, but I don't a bit of this [QSA] stuff :)


DocumentRoot /var/empty
ServerName sample.domain
ErrorLog /dev/null
CustomLog /dev/null standard

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ http://new.sample.domain:7777/forms90/f90servlet?config=sampletrng [QSA]



mod_redirect is much easier, but I don't remember how I used it.

something along

Redirect perm sample.domain new.sample.domain:7777/forms90/f90servlet?config=sampletrng


Your apache server contains the documentation on both modules, mix it with my examples and either You get something good to drink, or a working setup.
yesterday I stood at the edge. Today I'm one step ahead.
Steven E. Protter
Exalted Contributor

Re: redirecting url to a different url

Its possible with the virtual host directives, at least the http directive. You will need to have the oracle forms servelet configured to dierct sessions from

http://new.sample.domain:7777

to the oracle forms servelet.

Here is the virtual host configuration for httpd.conf

The trick here is the first httpd server needs to pass the directive to the oracle forms web server wich is customized.


Documentroot /root_of_oracle_server
...


Customizing HP's version of apache for forms servelets is probably not a good use of time since Oracle has alreadydone it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: redirecting url to a different url

Part 2.

Duh on me.

http://www.web-source.net/html_redirect.htm

Just have the Virtualhost directive go to a page with the html code on it in the index.html file.

This will push all traffic to the oracle forms servlet nicely.

Both domain names need to be resolvable by a DNS server available to your oracle users.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: redirecting url to a different url

Or, in the section of say a blank web page (index.html) at http://sample.domain , add:

<meta http-equiv="Refresh" content="0; url=http://new.sample.domain:7777/forms90/f90servlet?config=sampletrng" />


Full code for page would be:




Your Page Title
<meta http-equiv="REFRESH" content="0;url=http://new.sample.domain:7777/forms90/f90servlet?config=sampletrng" />


Optional page text here.



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.

Re: redirecting url to a different url

That worked great thanks. I do have another question though. What if http://sample.domain was not running at port 80 but rather at port 85 and I wanted to redirect it. Could I reference the original url of http: //sample.domain to load at port 85 then redirect to the given redirected url?


Thank again.


George
Florian Heigl (new acc)
Honored Contributor

Re: redirecting url to a different url

That would just be
or
redirect perm domain.com:85 ...

;)
yesterday I stood at the edge. Today I'm one step ahead.

Re: redirecting url to a different url

Good day,

I am working on the same issue but I really need to have this working through rules within httpd.conf.

I currently have ..


DocumentRoot /opt/apache/portal/htdocs
ServerName access-portal.my.domain.com ErrorLog /dev/null
CustomLog /dev/null standard

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ http://login-portal.my.domain.com [QSA]



But those rules does not works. I just get the local index.html page. Redirection is simply ignored.

Have a clue ?

Thanks,