keldorn Posted September 20, 2009 Share Posted September 20, 2009 I noticed on my site, I can take pages and put for example index.php/test/does/not/exist/ and it will return the index.php as if this were another page with 200 OK response and leave the slashes on there as if it were a directory. I dont know why that is working that way. I am not using path info urls nor do I have any .htacces rules Also I'm using Smarty template. Is there something in smarty that needs to be disabled? Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/ Share on other sites More sharing options...
ozestretch Posted September 20, 2009 Share Posted September 20, 2009 Am unsure the issue? http://www.phpfreaks.com/forums/index.php/topic,269829.0.html/test/does/not/exist/ Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921422 Share on other sites More sharing options...
keldorn Posted September 20, 2009 Author Share Posted September 20, 2009 Am unsure the issue? http://www.phpfreaks.com/forums/index.php/topic,269829.0.html/test/does/not/exist/ The issue is that it creates duplicate pages. A search will treat that link as a new page. http://www.php.net/downloads.php/a/fake/link/here/ http://www.youtube.com/index.php/look/a/fake/link That should return 404 not found. Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921452 Share on other sites More sharing options...
ozestretch Posted September 20, 2009 Share Posted September 20, 2009 Is not really a php related question... Those links you provide will not be a 404 as the actual page exists the server reads "index.php" as a file, not a folder... so no amount of slashes will convince it otherwise Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921468 Share on other sites More sharing options...
ozestretch Posted September 20, 2009 Share Posted September 20, 2009 unless of course your query is the fact it is a query string? in which case is still the same file/page... and if that page does not know those queries (more than likely a .htaccess thing. ) then it will display the page with its 'defaults' Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921469 Share on other sites More sharing options...
keldorn Posted September 20, 2009 Author Share Posted September 20, 2009 what I mean, is that Google, yahoo etc will crawl that link think its a new page? err well duplicate page. Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921597 Share on other sites More sharing options...
ozestretch Posted September 20, 2009 Share Posted September 20, 2009 Why would you create such links? Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921599 Share on other sites More sharing options...
Daniel0 Posted September 20, 2009 Share Posted September 20, 2009 <?php if (!empty($_SERVER['PATH_INFO'])) { header('HTTP/1.1 404 Not Found'); die('gtfo'); } Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921604 Share on other sites More sharing options...
ozestretch Posted September 20, 2009 Share Posted September 20, 2009 lmao at die('gtfo'); and great solution Link to comment https://forums.phpfreaks.com/topic/174842-how-do-i-stop-the-path-info-url/#findComment-921605 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.