ErikRobles's avatar

SEO and Laravel - Links appear Broken but work just fine

Hello Everyone. I have a quick question. I got my Laravel app up and running and when I do a broken link check with various online broken link checkers, all my links show up as broken. As this does have an impact on SEO, I was wondering how one goes about dealing with this. for example, in my wep.php, I have a route to my contact page which is {{ route('contact') }} . Now this works just fine and brings the user to the contact page but if you simply type https://mysite.com/contact you obviously are going to get an error because the route is actually pointing to root/frontend/pages/contact.blade.php So, Do I need to worry about this? If so, how does one fix this in an SEO perspective? Thank you in advance

0 likes
3 replies
Snapey's avatar

how does one fix this in an SEO perspective

Host your site so that the routes are clean

I hope your contact form is not at root/frontend/pages/contact.blade.php because thats a blade file, and your routes should be pointing to a controller.

1 like
CapPerez's avatar

have you tried using Laravel's named routes and ensuring all URLs are consistently generated with the route helper? This might improve both SEO and how link checkers perceive your site's structure. Additionally, are your routes cached? Clearing and re-caching routes often helps resolve similar issues. Let's see if this makes any difference!

1 like
CapPerez's avatar

I'd suggest checking your .env file for missing or incorrect APP_URL settings, and make sure route caching is set up properly—I’ve seen it solve similar issues before.

1 like

Please or to participate in this conversation.