This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Rewrite rule on Coldfusion
Author
Message |
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 08 March 2012 at 2:56pm

I have the following rule

RewriteCond %{QUERY_STRING} ^item_name=([^&]+)&item_id=([^&]+)$ [NC]
RewriteRule ^item\.cfm$ /%1/%2\.html? [NC,R=301,L]
RewriteRule ^([^/]+)/([^/]+)$ /item.cfm?item_name=$1&item_id=$2 [NC,L]

The rule works, however I am not able to browse certain folder as I am being redirected to items.cfm. Let's say I have www.website.com/blog/index.php. This path redirects me to www.website.com/blog/item.cfm. How do I fix this?
Back to Top Visit edba1970's Homepage
 
HeliconA
Admin Group


Joined: 02 March 2012
Posts: 4142
Posted: 13 March 2012 at 5:39am

Hello,

Please, try using the following:

Code:
RewriteCond %{QUERY_STRING} ^item_name=([^&]+)&item_id=([^&]+)$ [NC]
RewriteRule ^item\.cfm$ /%1/%2\.html? [NC,R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)$ /item.cfm?item_name=$1&item_id=$2 [NC,L]


This will prevent applying this rule foe real folders.

Regards
Andrew
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version