My web site's links are not working.
My site : https://overlap.ulb.be/public/
When I click on a link, I have a 404 NOT FOUND (on any link)
If I click on the link "à propos" (about), I have this link :
We can see that I don't have anymore the public name in the URL.
This is a part of my code (routes)
Route::get('about', [PlanteController::class, 'about']);
and the controller code :
public function about()
{
return view('phyto.about' );
}
And the view's code :
<x-phyto-layout>
<style>
.h4-about-first {
margin: 0 0 10px 0;
}
.h4-about-m20 {
margin: 20px 0 10px 0;
}
.h4-about {
font-family: "Lato", Helvetica, Verdana, sans-serif;
/*font-family: "Arial Rounded MT Bold", Helvetica, Verdana, sans-serif;*/
font-weight: 500;
line-height: 120%;
padding: 0;
/*padding-left: 0px;*/
/*margin: 0 0 10px;*/
/*color: #413d3d;*/
color: rgba(0, 0, 0, 0.5);
}
.h4-about {
font-size: 22px;
}
.p-about {
font-family: "Lato", Helvetica, Verdana, sans-serif;
font-size: 14px;
font-weight: 300;
line-height: 24px;
color: #413d3d;
/*margin: 0 0 18px 0;*/
margin: 0 !important;
padding: 0;
/*padding-left: 0px;*/
}
</style>
<!-- About page container -->
<div >
<div id="bloc-7">
<div >
<div >
<div id="bloc-13" style="">
<div >
<div >
<div >
{{--<h3 style="font-size: 24px !important" >À propos de nous</h3>--}}
<h4 >À propos de nous</h4>
<p {{--style="color:black !important"--}}>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci alias aliquid at aut ea
eligendi, enim esse ex excepturi in ipsam neque odio praesentium repellendus sed tenetur totam unde.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci alias aliquid at aut ea
eligendi, enim esse ex excepturi in ipsam neque odio praesentium repellendus sed tenetur totam unde.
</p>
{{--<h3 style="padding-top: 24px;font-size: 24px !important" >Projet Phyto ?</h3>--}}
<h4 >Projet Phyto ?</h4>
<p {{--style="color:black !important"--}}>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci alias aliquid at aut ea
eligendi, enim esse ex excepturi in ipsam neque odio praesentium repellendus sed tenetur totam unde.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci alias aliquid at aut ea
eligendi, enim esse ex excepturi in ipsam neque odio praesentium repellendus sed tenetur totam unde.
</p>
{{--<h3 style="padding-top: 24px;font-size: 24px !important" style="padding-top: 30px" >Collaborateurs</h3>--}}
<h4 >Collaborateurs</h4>
<p {{--style="color:black !important"--}}>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci alias aliquid at aut ea
eligendi, enim esse ex excepturi in ipsam neque odio praesentium repellendus sed tenetur totam unde.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium adipisci alias aliquid at aut ea
eligendi, enim esse ex excepturi in ipsam neque odio praesentium repellendus sed tenetur totam unde.
</p>
<h4 >Nom latin</h4>
<p {{--style="color:black !important"--}}>
Le nom latin fait référence à la dernière classification (lien : www.derniere-classification.org)
</p>
<a href="/gpd?p=search" >
Recherche de plantes
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- bloc-7 END -->
Thank you
{{--<div id="home-about">
<div >
<div >
<div >
<img src="/images/valeriane_rouge.jpg" data-src="/images/valeriane_rouge.jpg" >
</div>
<div >
<h2 >Qu'est ce que ULB-PHYTO?</h2>
<p >
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus dicta error explicabo,
harum hic ipsam laboriosam molestiae nihil odit optio porro provident repellendus
saepe sed sequi similique velit vitae, voluptatem?
Lorem ipsum dolor sit amet, consectetur adipisicing elit. A accusantium amet delectus,
dicta dolor ea eligendi ex, excepturi facere
incidunt iste maiores porro possimus, qui rerum velit vitae voluptatem! Repudiandae.
</p>
</div>
</div>
</div>
</div>--}}
I also have a .htaccess :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
CodePudding user response:
your issue was not loading your asset correctly. you can put the full URL of styles and javascript in your app layout including the public or you can use the asset function to generate a URL for an asset using the current scheme of the :
<link rel="stylesheet" type="text/css" href="{{asset('css/style.css')}}">
if you are using the asset method you should put the ASSET_URL variable in your .env file
ASSET_URL=https://overlap.ulb.be/public
UPDATED if you mean images in your style you have two solutions, you can write inline style in your blade in this case you can use the asset method like the above example OR change all background URLs in the external style CSS file with
background-image: url("/public/images/...");