我写我的.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