我有一個腳本,使搜索和我想要的結果也與查詢訪問重寫引擎的.htaccess MIME類型錯誤
mysite.com/searchfor/"myword"
我加入下一行爲.htaccess:
RewriteEngine on
RewriteRule ^/?searchfor/(.*)$ search.php?search=$1 [L]
它(頁面正在加載),但每個鏈接的資源(css/js)都無法加載下一個錯誤:
Resource interpreted as Stylesheet but transferred with MIME type text/html
Resource interpreted as Script but transferred with MIME type text/html:
這些行ref呃到mysite.com/searchfor/theme.css,但它是錯誤的,因爲正確的鏈接到css是mysite.com/theme.css。
我懷疑RewriteEngine給出加載樣式和腳本的路徑失敗。 如何解決這個問題?
它沒有幫助 – Tigran
如果您嘗試在瀏覽器中使用其URL打開只是css文件,會發生什麼情況? – anubhava
它打開我的搜索頁面作爲搜索的CSS名稱。例如,打開theme.css將搜索「theme.css」 – Tigran