CodeIgniter Forums
Routing with "&key=value parameters - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Routing with "&key=value parameters (/showthread.php?tid=66448)



Routing with "&key=value parameters - mirrek74 - 10-23-2016

I have a question what might be very basic but I can't find the solution for it..

I have a route set to 
$route['action-name/(.*)'] = 'main/procedure/$1';

it works great, but I've noticed when evaluated my SEO stats that I'm getting 404 errors when google indexes the pages.. The reason seems to be that Google adds certain parameters ad the end of the url, which causes the routing to fail...

404. That’s an error.
The requested URL was not found on this server. That’s all we know.
Code:
/search?q=cache:zDt-ObjwbuEJ:https://website.com/action-name/object-permalink+&cd=22&hl=en&ct=clnk&gl=us


when typed directly into the browser's address bar, I get this:
Fatal error: Class 'CI_Controller' not found in /home/jml/public_html/website.com/system/core/CodeIgniter.php on line 366

How do I get around it? When I remove the part added by Google, it works as supposed to.. Can I somehow just ignore the added parameters? Would I set it in route.php or htaccess?

Please advice, 
Many thanks in advance
Miro


RE: Routing with "&key=value parameters - Paradinight - 10-23-2016

it looks very wrong Huh
if a site is not found it should be 404 Page Not Found.

have you changed something in the system folder? Codeigniter version?


RE: Routing with "&key=value parameters - mirrek74 - 10-23-2016

thaks for responding..

it's version 3.0.0. haven't changed anything, all files in system folder have identical Last Modified date/time stamp..

I'm clueless... :-(


RE: Routing with "&key=value parameters - d4jk4 - 10-23-2016

I think QUERY_STRING is not problem?

you can parse QUERY_STRING to array

parse_str($_SERVER['QUERY_STRING'], $get);

var_dump($get) to check values