I have a website too extensive editing the URLs of styles css
and files js
, images
would cost me too much time.
I'm working at localhost
localhost/project/index.php
The friendly url I want to have:
localhost/project/index/
From this url
localhost/project/online.php
to this
localhost/project/online/video/hd/free/
I have observed this website http://crazycafe.net/demos/seo/ and its source code, the styles css
is maintained this way: <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
without adding an absolute URL to styles css
and their files and images
.
How do i create a friendly url this way?
If the user modifies the url in this way:
http://crazycafe.net/demos/seo
Redirect to this way:
http://crazycafe.net/demos/seo/
On the other hand like conserving the styles css
the files js
and images
, without having to modify to an absolute route.
My file directory is:
assets/css/style.css
assets/js/app.js
assets/fonts/icons/image.png
assets/fonts/ttf/roboto.ttf
assets/img/system/image.png
assets/img/logo.png
Note:
I found this question in SO, of how conserve CSS styles.
But I do not understand the use of friendly URL - .httaccess
You need to switch on mod_rewrite and use it. Example:
Folder-based example:
Your case:
See more here.