jpress07 Posted June 9, 2008 Share Posted June 9, 2008 hi guys, Is there a way I can mask a php redirect so once the page has redirected, the new destination URL does not display in the address bar? For example, my page hxxp://mysite.com/affiliate-redirect.php has the following code: <? header( 'Location: hxxp://affiliate-link.html' ) ; ?> How do I get hxxp://mysite.com/affiliate-redirect.php to stay displayed in the browser address bar after redirecting to affiliate-link.html? Many thanks for any help! Cheers, JP Quote Link to comment Share on other sites More sharing options...
Lumio Posted June 9, 2008 Share Posted June 9, 2008 What is hxxp? I only know http. You can solve it with frames, what you want. Quote Link to comment Share on other sites More sharing options...
jpress07 Posted June 9, 2008 Author Share Posted June 9, 2008 I just put hxxp instead of http to make the links inactive in my post. As for the masking, I do not want to use frames, is there any way I can do this with php? Quote Link to comment Share on other sites More sharing options...
trq Posted June 9, 2008 Share Posted June 9, 2008 I do not want to use frames, is there any way I can do this with php? Not really. The only thing you could do would be to include the file in question, instead of actually redirecting to it. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted June 9, 2008 Share Posted June 9, 2008 You could also use mod_rewrite for the same effect. Quote Link to comment Share on other sites More sharing options...
Guest Xanza Posted June 9, 2008 Share Posted June 9, 2008 I know your question has already been answered, but I speak from experience - their is no way other than using an iframe (and mod_rewrite).. Quote Link to comment Share on other sites More sharing options...
Nick_Ninja Posted June 9, 2008 Share Posted June 9, 2008 Maybe what you want is a cURL request. That will request the file, then you can print it out. This works badly with Javascript Images Flash So you'll have to edit the page on the fly a little bit. The hardest part is when the javascript calls SWFObject or write() to add flash. My suggestion? Step one: replace afflicate.com with yoursite.com/get_file_from_other_website this redirects all absolute images/flash to your website Step two: do the relative ones somehow Step three: include a javascript file with the functions writeredirect and SWFObjectredirect Step four: replace SWFObject with SWFObjectredirect and write with writeredirect Step five: get_file_from_other_website.php should contain code to request that resource/caching function Honestly, this is harder than frames Note: Step 1/Step 5 hack will ONLY work on apache servers Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 9, 2008 Share Posted June 9, 2008 Browsers execuite redirects (the header() statement just tells the browser what address to request), so for an actual redirect the address bar will always show the actual address. The only way you can display your site's address in the address bar would be if you read/include/request the content of the page that you would have redirected to and output it on your page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.