chrischen Posted August 4, 2008 Share Posted August 4, 2008 So I'm trying to retrieve URL in http://www.mysite.com/page1.php?url=http://www.yahoo.com in $_GET['url'] when I access that page. However if I do it like above $_GET['url'] it returns http:/www.yahoo.com with a missing slash. If I url encode http://www.yahoo.com (http://www.mysite.com/page1.php?url=http%3a%2f%2fwww.yahoo.com) the %2F (the slash) causes it to fail with "Not Found The requested URL /page1.php?url=http://www.yahoo.com was not found on this server." Running Apache2.2 and Zend Core (latest version). Thanks, Chris Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/ Share on other sites More sharing options...
ohdang888 Posted August 4, 2008 Share Posted August 4, 2008 all sites use http:// so don't bother using it, if you need it you can add it later just use www.yahoo.com Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/#findComment-607996 Share on other sites More sharing options...
chrischen Posted August 5, 2008 Author Share Posted August 5, 2008 Yea, but is there still a fix to this? I'm guessing it's some Apache configuration. Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/#findComment-608252 Share on other sites More sharing options...
sKunKbad Posted August 5, 2008 Share Posted August 5, 2008 You might try mod rewrite. Why is the http:// necessary? Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/#findComment-608295 Share on other sites More sharing options...
blufish Posted August 5, 2008 Share Posted August 5, 2008 You could do http:--www.yahoo.com and then str_replace the -- with //. Not the best idea but it would work. Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/#findComment-608380 Share on other sites More sharing options...
abdfahim Posted August 5, 2008 Share Posted August 5, 2008 well, I test it in my PC and it works fine here!! Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/#findComment-608414 Share on other sites More sharing options...
chrischen Posted August 5, 2008 Author Share Posted August 5, 2008 Ok, thanks. Actually I was just gonna take in the www.yahoo.com and add in http:// afterwards. But it's still weird because I have SMF installed on the same server and in one of their URLs they take http:// and it works not only that I type in %2F in their URL (on the same server) and it produces NO ERROR. I hope this doesn't turn out like that time I spent hours trying to figure out what made some of my pages shift left (turned out to be the scrollbar appearing and disappearing). Link to comment https://forums.phpfreaks.com/topic/118139-solved-url-within-a-url/#findComment-609003 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.