CodeIgniter Forums

Full Version: Route with timestamp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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?