2015-03-13 74 views
0

我有這個網址:?如何創建.htaccess文件重新建立一個frindly URL

本地主機/ prefinal/profile.php用戶名=管理員

,並希望把它:

本地主機/ prefinal /資料/管理員

我使用.htaccess文件一第二設置以下規則:

RewriteRule ^profile/([^/]*)$ /prefinal/profile.php?username=$1 [L] 

頁工作正常..但CSS是不是在它的工作:

not work css

應該是:

work css

謝謝

+0

你需要在你的HTML的標題加上基本href =「」 .. – Naruto 2015-03-13 12:21:00

回答

1

您的HTML酸味如何看起來像(link標籤到樣式表)? 我想你應該之前重寫規則添加幾行

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule ^profile/([^/]*)$ /prefinal/profile.php?username=$1 [L] 
+0

它是PHP而不是HTML 這是我的樣式錶鏈接: < link rel =「stylesheet」type =「text/css」href =「style/css.css」> – Shifter 2015-03-13 19:24:14