0

I just started learning Laravel, and I faced an issue. I made two view files. The first one is home.blade.php and the second one is welcome.blade.php. In the routes folder, web.php, I used the Route::redirect('/home', '/welcome'); redirect method, which redirects me to the welcome file. When I write in the localhost URL like this http://127.0.0.1:8000/home, it correctly redirects me to the welcome view page, and the URL changes to http://127.0.0.1:8000/welcome. But then I removed the redirect method code and also deleted the welcome view page, yet it still redirects me to the welcome page when I write home in the URL. I asked ChatGPT, and it told me to run the PHP artisan commands to clear the cache and the view. I did exactly the same, but after this, I still face the same issue. When I write home in the URL, it redirects me to the welcome page, which doesn’t even exist and shows a 404 error.

I want that when I write home in the URL, it opens the home.php file and not redirects me to the welcome.php file, which doesn’t even exist.

5
  • Can you try this in another browser, or by appending a query string to the URL? I'm just guessing, but browsers are notorious for "remember" redirects Commented Jan 17 at 18:35
  • Hello Muhammad, you would need to share some portion of code related to this as we do not have visibility over the issue you are facing. Commented Jan 17 at 18:36
  • Can you share the exact commands you tried? You haven't mentioned clearing the route cache so you could try that too. Also check your storage/framework/views, storage/framework/cache and bootstrap/cache folders in case there are any persistent files in there that should be deleted as well (assuming this is indeed a caching issue and there's nothing else going on) Commented Jan 17 at 18:57
  • @ChrisHass yes I tried in both Chrome and Microsoft edge browser and also restart my pc but the issue does not resolve. – Commented Jan 18 at 9:56
  • @Olumuyiwa sure i write this [127.0.0.1:8000/home] in url which redirects to welcome page the code I write in the web.php is Route::redirect('/home', '/welcome'); and in welcome page i simply write welcome message Commented Jan 18 at 10:01

1 Answer 1

0

Just clear browser cache. I faced same problem and fixed by clearing browser data.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.