1
votes

I am doing simple pagination on a query.

The pagination links at the bottom of the page are pointing to

http://localhost/reddit/public/subreddit/?page=1

but when I click on it, I get redirected to

http://localhost/subreddit?page=1

with the error

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error:

If you think this is a server error, please contact the webmaster.

Error 404

localhost

Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.11

But if I manually go to http://localhost/reddit/public/subreddit?page=2 the page loads fine.

This is the url in config/app.php

'url' => 'http://localhost/reddit/public',
1

1 Answers

1
votes

Since your url is set to http://localhost/reddit/public, Laravel will generate relative links based on the url configuration. In other words, it's taking out http://localhost/reddit/public from all the links, and only adding subreddit?page=1

Setting the url field in config/app.php back to 'url' => 'http://localhost/', should fix the problem