我在"My dog is %s" % fido.to_s
文档
.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
或category/business
或category/business/
或category/BUSinesS/
对于以下问题,此行如下所示:
答案 0 :(得分:1)
试试这个:
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /searchPage.php\?crs_category=([^\s]+) [NC]
RewriteRule ^ category/%1? [NE,NC,R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^category/([^/]+)/?$ searchPage.php?crs_category=$1 [QSA,L,NC]