Alizey's avatar

Pagination Base Url Problem

this is my home url : http://localhost/dreamJobs my problem is with my pagination when i clicks on page 2 laravel skips my root folder name and i got this url :http://localhost/dreamJobs/ But When i click On Pagination Pagination truncated My url : http://localhost/view?page=2

0 likes
4 replies
Sonu's avatar
Sonu
Best Answer
Level 3

@Alizey its due to your Htaccess file. You have to mention Your RewriteBase In Htaccess File

Options -MultiViews
RewriteEngine On
RewriteBase /dreamJobs/

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ $1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Use this Hope Its works.

Mario Nava's avatar

Hi everyone,

I'm having the same issue. I did what @Sonu said, but it is not working for me.

In my case, on local environment everything works ok, the trouble is when I change this on production environment.

Any idea?

1 like
Sonu's avatar

@Mario Nava @ live environment change the RewriteBase Like

RewriteBase /

Please or to participate in this conversation.