Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced redirection: from page123.cgi to page123.shtml

Status
Not open for further replies.

jobi

Technical User
Jun 30, 2000
24
NO
A cgi news publisher creates the pages on my site. ( etc.)

I want to include these cgi pages in other pages. An example:
When a visitor clicks on this link, created automatically by the news publisher: I don't want this page to be loaded. Instead I want to redirect the visitor to
Then I want to be a part of
I've seen similar functionality with frames, where a spesific page always opens only in a frameset (even if you go directely to this spesific page).

Hope you understand what I mean. Any suggestions?
 
Use an iframe element. Pull them in to that box and it will display properly in this century's browsers. With iframe you can remove the outline and make it seamless.
 
I did not explain this good enough.

I want this to happen in a dynamic way.
page1234.cgi shall be a part of page1234.shtml. I want the same for 1233.cgi, 1232.cgi, and all the other 2000 pages.

This means I can't MAKE all the shtml pages, these pages must be "created" because the cgi pages are visited. I suppose I have to use a script or something. All this must happen automatically.

I compared to frames because I can add a tag in every page that always opens this page in a frame. I need some kind of tag or script this time too.
 
Call the cgi you want displayed in the src= tag of the iframe and it will be dynamic. If you want to rotate which one is displayed you will need a script to manage which one is placed in the src= tag.
 
Hi mate,

You would be better doing this with a Rewrite rule in the server config.

Do you have access to the server config? If so, what type of server are you using?

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
No, I don' have access to the server config. Does it exist a script that can do this for me?
(I need it to create the shtml file automatically.)
 
Not quite sure I understand - is this what you need?

//////////////////// redirect.html ////////////////////
<A HREF=&quot;page1234.cgi&quot;>1234</A><br>
<A HREF=&quot;page4321.cgi&quot;>4321</A>


//////////////////// page1234.cgi ////////////////////
#!/usr/bin/perl

print &quot;Content-type:text/html\n\n&quot;;

print &quot;<SCRIPT LANGUAGE=\&quot;JavaScript\&quot;>\n&quot;;
print &quot;<!-- Begin\n&quot;;
print &quot;window.location=\&quot;print &quot;// End -->\n&quot;;
print &quot;</script>\n&quot;;
print &quot;<noscript>\n&quot;;


//////////////////// page4321.cgi ////////////////////
#!/usr/bin/perl

print &quot;Content-type:text/html\n\n&quot;;

print &quot;<SCRIPT LANGUAGE=\&quot;JavaScript\&quot;>\n&quot;;
print &quot;<!-- Begin\n&quot;;
print &quot;window.location=\&quot;print &quot;// End -->\n&quot;;
print &quot;</script>\n&quot;;
print &quot;<noscript>\n&quot;;


This uses a javascript redirect to redirect the user immediately to the appropriate .shtml page

Duncan
 
I may be on the wrong wave link with this but why not use the following in the first web page to auto redirect to the second page where ever it is.

<html>
<head>
<META HTTP-EQUIV=&quot;REFRESH&quot; CONTENT=&quot;Pragma&quot; CONTENT=&quot;no-cache&quot;>
<META HTTP-EQUIV=&quot;REFRESH&quot;
CONTENT=&quot;10; URL=MY.PERSONAL.HOME.PAGE.HTM&quot;>
</head>

You can name what ever page you want or a cgi program. In this case it will transfer in 10 seconds but you could set it to 0 to transfer immediately.

This also helps capture a visitor if they don't understand much. A use of the
BACK function just goes back and then forward again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top