Question:
PHP Redirection by HREF Link (.php=siteurl?)?
David B
2012-05-02 22:08:01 UTC
I'm in the midst of setting up a Joomla CMS & phpBB board for a website aimed at the audience of our Night Club. There are going to be a number of external redirects to sites other than the main site. Rather than redirect a visitor DIRECTLY to said external site, I need a PHP page that states redirection is occuring and disclaims we are not responsible for the contents on the external site, and they have the option to continue or go back. To save having to make a page for EACH link I would like to know if a variable can be used in ONE page where the HREF dictates redirection, so for example, they click the hyperlink which might be linked as www.mysite.com/redirect.php?v="http://www.othersite.com" which in turn takes them to redirect.php, if they click continue, they are brought to the page in the HREF, if they click back, they are taken to the page they came from. I know this is possible as I have seen it before but Google, despite using advanced search strings and terms is not revealing anything useful. Any help is very much appreciated.
Three answers:
JustMe
2012-05-03 06:42:04 UTC
Get used to the fact that if you work with Joomla, there's no reason for you to ever mess with PHP files (with some rare exceptions). Everything is accomplished with extensions. Joomla has almost 9500 of them. This is the one you need - http://extensions.joomla.org/extensions/site-management/url-redirection/12560

Good luck.
2012-05-04 05:02:03 UTC
You need to create a System plugin that will call your PHP file and do the redirection for you.



Source: We work on Joomla websites at http://www.itoctopus.com
tica
2012-05-03 01:14:16 UTC
use jquery to change link href to a file made by you...lets say redirect.php

and then with jquery change link to redirect.php?url=oldurl&fromurl=pagefromwhereyouclicktheurl



and then just make 2 links for the 2 pages....



to parse the links just change the links that starts with http:// and not with http://yourdomain.com


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...