Pagination not working on live server (apache)

Posted 4 months ago by MartiX

Hi guys,

I've been working on Laravel web app quite a while, now it's time to deploy the site, but a strange problem occurs.

Everythings works fine on development server, but the pagination seems broken on live server. This is the route:

Route::get('/articles/{category}', '[email protected]');

Now the pagination add to URL this "?page=2", which is okay and works fine on the dev server, problem is, that when I click on the page 2 or whatnot, I'm redirected back on the same page with the same list of articles. URL changes but nothing besides redirect to the same list happens.

I think this may be the problem with my .htaccess, well this is not quite my area so I just asume. Does anyone know, what might be the problem?

This is my .htaccess:

<IfModule mod_rewrite.c>    
    <IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
   </IfModule>

    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    RewriteCond ^(.*)$ https://example.com/ [R=301,L]

    ErrorDocument 404 https://example.com

    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?/ [L]
</IfModule>

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.