我在下面的方式創建的.htaccess.htaccess文件一點兒也不正常工作
RewriteEngine on
RewriteBase /school1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?path=$1 [L,QSA]
我的意思是,當用戶打'school1/schools/schools'
他們將得到「school1 /的index.php?路徑的內容=學校/學校'這是正常工作,但CSS JS和圖像請求將根據目錄school1/schools/[js|css|img]/...
而不是school1/[js|css|img]
我不明白爲什麼他們從URL獲得學校部分。 如果我火http://demo.cwdesigns.org/school1/dashboard
它呈現正常,但當我fire http://demo.cwdesigns.org/school1/schools/schools
請幫我我浪費了我很長一段時間的這個問題。如果你想要任何額外的信息,請評論它。
更新1 按照第一個答案我已經基本標籤添加到我的頭節
<head>
<base href="http://demo.cwdesings.org/school1" />
<meta charset="UTF-8">
<title>Student Portal | Dashboard</title>
,但它似乎沒有工作。
其中應基本標記添加在頭部或任何地方在網站 – siddhesh
@siddhesh裏面的'
'標籤 –我已經用我的header.php文件添加了基本標籤更新了這個問題,但是不起作用。 – siddhesh