Reputation: 1305
I want everytime people go to my website, it will automatically redirect to another website, say:
https://www.redirect.com/link?q=NEWSTRING
it sounds weird, but actually, what I want is when people load my page, it will trigger some scripts, in which it can tract "NEWSTRING" from some website, then put it to the link above to redirect my website there. So what I have is a first part of the link, which is fixed:
https://www.redirect.com/link?q=
then
NEWSTRING
is obtained from my script, now how to write some thing that will redirect the webpage? What I can think of is, write something in python.py, then rename it to .cgi, then upload it to my server at :
/home/xxxxx/public_html/cgi-bin/python.cgi
Will this make my website automatically load and redirect there ? Thanks a lot !
Upvotes: 0
Views: 68
Reputation: 3576
Why not just use straight HTML to redirect to the website you want? I might not understand your question correctly, but for example
<meta http-equiv="refresh" content="0; url=http://example.com/">
would redirect the user to http://example.com when loading your page.
Upvotes: 1
Reputation:
What you need is an AJAX request.
When people load your web page, the page sends an AJAX request to some other site, and render your page after getting the request result.
Upvotes: 0