0

How to use a base tag in html5 and where to use and in which tag we have to use

16th May 2020, 3:27 PM
ARINWESH KRISOLOGES LAKRA
ARINWESH KRISOLOGES LAKRA - avatar
2 Answers
+ 3
When we are rewriting urls. If I link files like this which is not good img/img.jpg css/style.css And we rewrite the url of the file that uses these. /profile.php For example we rewrite the url of the above profile file with .htaccess to look like this /user/{user_id}/ Now when you access that url, it will request all other sources based on it. For example /user/{user_id}/img/img.jpg /user/{user_id}/css/style.css Those doesn't exist. We can prevent that with the base tag. It will request all other sources based on it, not the actual url. I would fix that by adding this to the profile.php header <base href="http://localhost/"> there's no use for that. Start your paths with slash "/". And It requests it from the root directory
16th May 2020, 3:47 PM
Toni Isotalo
Toni Isotalo - avatar
0
Thank u
17th May 2020, 2:32 AM
ARINWESH KRISOLOGES LAKRA
ARINWESH KRISOLOGES LAKRA - avatar