我寫我的.htaccess
文件與htaccess的工作 - 網頁沒有被正確加載
RewriteEngine On
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^category/([a-z]+)/?$ searchPage.php?crs_category=$1
RewriteRule^index.php [QSA,L]
我認爲這個問題在下面的行發生在下面的代碼:
RewriteRule ^category/([a-z]+)/?$ searchPage.php?crs_category=$1
基本上我想,當用戶類型searchPage.php?crs_category=business
它將url重寫爲category/business
或category/business/
或category/BUSinesS/
或category/BUsineSS
因爲它代表了以下問題此行是如下:
- 的CSS/JS似乎加載
- 它只有當我鍵入類/業務/如果我鍵入searchPage.php工作?crs_category =業務並不重定向或重寫,以乾淨的URL
重寫[R ule將無法爲你做到這一點。使用JavaScript,看看這裏http://stackoverflow.com/questions/3338642/updating-address-bar-with-new-url-without-hash-or-reloading-the-page – Jigar