CodeIgniter Forums
Route with timestamp - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: Route with timestamp (/showthread.php?tid=68864)

Route with timestamp - jorrik9 - 09-05-2017


I need a way to prevent a page from getting cached, so I added a timestamp to the url like this:

echo '<li>' . anchor('/account/?_='. time(), 'My Account', array('class'=>'leaf last')) . '</li>';

This gives a link like: /account/?_=1504635140

The route looks like this:

$route['account']                                  = 'account';
$route['account/(:any)']                           = 'account/$1';

This doesn't work because it results in a nginx 404 Page not found.

Any idea how to get this working?