Kamlesh DjKammu
Kamlesh DjKammu

Reputation: 33

Getting issue in url Laravel

The URL working fine with http://localhost/townlabour4/tl/DjKammu

but when I put '/' after that issue created. http://localhost/townlabour4/tl/DjKammu/

It goes to http://localhost/DjKammu with error Object not found.

Upvotes: 1

Views: 49

Answers (1)

Pyton
Pyton

Reputation: 1319

The best way is to stick with non-trailing slash. Easiest way is to add .htaccess rule:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]

or with Nginx in server block:

rewrite ^/(.*)/$ /$1 permanent;

Upvotes: 1

Related Questions