Problem with CSS with friendly url

0

Well, I'm studying friendly urls and I came across a problem. Every time I put a / (slash) at the end of the url, the css disappears and the page gets pure html. I'd like to understand what's going on and fix it. Follow the images below for a better understanding.


    
asked by anonymous 08.11.2016 / 18:25

1 answer

0

The best solution (depending on your application) is to use the base HTML5 tag.

<base href="http://seusite.com/" target="_blank">

See an example on the w3schools site.

Another method is to get the system root folder and play it at a constant. Since you have not shown which server side language you are using, I will show the example in PHP.

<?php

define("ROOT", __DIR__); //obtém pasta root

In your code you use

<img src="<?=ROOT?>/stickman.gif" width="24" height="39" alt="Stickman">

There are still a number of other examples, but I think these may be enough to heal your doubt and help you.

    
08.11.2016 / 18:38