URL重写语法IIS 8 ISAPI重写3

时间:2014-01-10 11:09:41

标签: iis coldfusion coldfusion-10 isapi-rewrite

我之前有关此事的帖子:

ISAPI_Rewrite and Coldfusion Rules

在Helicon支持的帮助下,我们能够创建以下规则:

RewriteEngine on

RewriteRule on
RewriteBase /

RewriteCond %{QUERY_STRING} ^filter=brand&brand_id=([^&]+)&brand_name=([^&]+)$ [NC]
RewriteRule ^products-search\.cfm$ /search/%1/%2.cfm? [NC,R=301,L] 

RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^search/([^/]+)/([^._]+)\.cfm$ /products-search.cfm?filter=brand&brand_id=$1&brand_name=$2 [NC,L]

RewriteCond %{QUERY_STRING} ^product_id=([^&]+)&product_title=([^&]+)$
RewriteRule ^product-details\.cfm$ /%1/%2.cfm? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^._]+)\.cfm$ /product-details.cfm?product_id=$1&product_title=$2 [NC,L] 

他们非常感谢他们的帮助,因为我对URL重写非常新。我现在遇到的问题是第一条规则有效,它将网址改为:

www.mysite.com/products-search.cfm?filter=brand&brand_id=98&brand_name=HAMANN

www.mysite.com/search/98/HAMANN.cfm

由于我是新手,我不明白如何在这个页面上显示css / js / images文件夹,我使用什么规则或条件RewriteBase / part,以便页面上的所有内容正确加载?

.htaccess规则的第二部分实际上并没有改变:

product-details.cfm?product_id=1&product_title=This Is A New Product 

products/This_Is_A_New_Product.cfm

非常感谢任何帮助

0 个答案:

没有答案