Skip to content
Advertisement

Laravel page redirection issue

Hi I am laravel beginner and having problem during page navigation.

JavaScript

In index page I have few items and below href to see the details of that item based on item id.*

JavaScript

Now when I click on item details, I get the below URL which is ok.

JavaScript

Now from that page when I am clicking Home it’s adding index page end of single [single/index !!!]

JavaScript

I tried to add a slash but it’s redirected me to

JavaScript

Here is my .htaccess

JavaScript

Any help will be appreciated.

Advertisement

Answer

On live it is just required to pass /index

JavaScript

and it will redirect you to

JavaScript

but on the localhost, you have to add the directory name also(Note: on live there will be no folder name. So /index will work there).

JavaScript

Or, you have to run laravel through artisan server, then /index will work on your localhost also.

You are facing this issue because when we give / before URL, it concatenates the given URL with the host and on XAMPP we have to concatenate folder name after localhost.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement