0
我有一個網站編輯樣式爲css
和文件js
,images
的網址太多,會花費我太多的時間。網址友好而不失風格css/js/images
我在本地主機工作
localhost/project/index.php
友好的URL我想有:
localhost/project/index/
從這個網址
localhost/project/online.php
這個
localhost/project/online/video/hd/free/
我觀察這個網站http://crazycafe.net/demos/seo/及其源代碼,css
保持這樣的風格:<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
無需添加絕對URL將樣式css
其文件和images
。
如何創建友好的URL這種方式?
如果用戶修改這樣的網址:
http://crazycafe.net/demos/seo
重定向到這樣的:
http://crazycafe.net/demos/seo/
在另一方面喜歡節約的樣式css
文件js
和images
,而不必修改爲絕對路線。
我的文件目錄是:
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
注:
我發現這個question在SO,如何節約CSS樣式。
但我不明白,使用友好的URL的 - .httaccess
不工作,此錯誤顯示:服務器錯誤 –
代碼可能與您的其他代碼在.htaccess中不兼容。嘗試做一些實驗並讓我知道結果。 –
嗨! @LajosArpad結果是那些說服務器錯誤不顯示頁面並顯示錯誤。 –