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: ColdFusion 9 on Server 2008
Author
Message |
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 28 November 2011 at 11:01am

error.log shows that everything has loaded successfully. Here's the rewrite.log:
Code:

76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:01 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (2) init rewrite engine with requested uri /search1.cfm?style_number_id=5&item_category=FEB
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:01 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (1) Htaccess process request c:\inetpub\wwwroot\facets\.htaccess
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (3) applying pattern '^search1\.cfm$' to uri 'search1.cfm'
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (4) RewriteCond: input='style_number_id=5&item_category=FEB' pattern='(.+)' => matched
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (5) map lookup FAILED: map=mapfile[txt] key=style_number_id=5&item_category=FEB
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (4) RewriteCond: input='NOT_FOUND' pattern='NOT_FOUND' => not-matched
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (3) applying pattern '^(.+)$' to uri 'search1.cfm'
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (4) RewriteCond: input='\\?\C:\inetpub\wwwroot\Facets\search1.cfm' pattern='!-f' => not-matched
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (4) RewriteCond: input='\\?\C:\inetpub\wwwroot\Facets\search1.cfm' pattern='!-d' => matched
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (5) map lookup FAILED: map=revmapfile[txt] key=search1.cfm
76.12.161.154 76.12.161.154  Mon, 28-Nov-2011  11:14:02 GMT [www.thefacetscollection.com/sid#4][rid#23556952/initial] (4) RewriteCond: input='NOT_FOUND' pattern='NOT_FOUND' => not-matched


Edited by edba1970 - 28 November 2011 at 11:09am
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 29 November 2011 at 4:46am

Well,

Quote:
(2) init rewrite engine with requested uri /search1.cfm?style_number_id=5&item_category=FEB
(1) Htaccess process request c:\inetpub\wwwroot\facets\.htaccess
(3) applying pattern '^search1\.cfm$' to uri 'search1.cfm'
(4) RewriteCond: input='style_number_id=5&item_category=FEB' pattern='(.+)' => matched
(5) map lookup FAILED: map=mapfile[txt] key=style_number_id=5&item_category=FEB
(4) RewriteCond: input='NOT_FOUND' pattern='NOT_FOUND' => not-matched


There's a possibility you haven't provided sufficient permissions for mapfile to be read. So it fails the lookup.
Please, follow the article to provide permissions.

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 29 November 2011 at 8:50am

I have given all the necessary permissions to mapfiles. The only thing I do not have is IIS_WPG group on my server which is mentioned in the link which you have provided. Do I have to create this group? I have given a System and to IIS_IUSRS full permissions and still doesn't work.


Edited by edba1970 - 29 November 2011 at 9:02am
Back to Top Visit edba1970's Homepage
 
abosch
Newbie


Joined: 04 August 2009
Location: United States
Posts: 1
Posted: 29 November 2011 at 9:12am

IIS_WPG exists on Windows Server 2003, but not on Windows Server 2008. You need to set permissions for the account Network Service.

To add to the confusion, it is possible to use the special domain name IISAPPPOOL with the name of the IIS application, like IISAPPPOOL\AppName, to give permissions for a specific part of your site. This happens if you have Windows Server 2008 SP2. You need to use the icacls command to set it, though. The GUI part of the security editor does not work with IISAPPPOOL.
Back to Top Visit abosch's Homepage
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 30 November 2011 at 4:16pm

I have given Network Service permission to my hosting and changed NetworkService pool to ApplicationPoolIdentity and added defaultapppool to folder permission. Am I am missing anything because it still not working. Your fast response would be greatly appreciated.

Thank.


Edited by edba1970 - 30 November 2011 at 4:19pm
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 01 December 2011 at 4:31am

Then there's a mistake in mapfile:

style_number_id=value&item_category=FEB
style_number_id=5&item_category=FEB

Is there' a way have request one of these and there's another one in mapfile?

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 02 December 2011 at 11:03am

I am sorry I couldn't understand your last response. do I need to put these in my map file?

style_number_id=value&item_category=FEB
style_number_id=5&item_category=FEB

Your question was also unclear.

I have tried to modify the style_number_id=value to style_number_id=5 in the map file and it worked. But those numbers are always changing so it has to stay as "value".

I also tried to check the query string and it returns item_category=${revmapfile:} instead of the real query string. If the query string is not read, the website displays all the contents instead of filtered ones.


Edited by edba1970 - 02 December 2011 at 12:42pm
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 05 December 2011 at 4:08am

Well, I was wondering if the entry you request is exactly the same you have in mapfile.
Eventually it turned out that you were expecting dynamic value in the rule. While mapfile requires static value.
Is it possible to hardcore all values in mapfile?

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 05 December 2011 at 9:20am

The FAQ is not very clear. I was under the assumption that the map file is accepting dynamic values. I have about 400 dynamic pages  and having all of them in the map file is not practical.  Isn't there any other way to do this?

Also, I would like to find out why I can't  get the query string. Instead of the query string I get item_category=${revmapfile:}.

Thank you.
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 06 December 2011 at 7:01am

Well,

While you're trying to get absolutely unrelated "ugly" and "nice" work together, you need a place to store them.
Unless,you need only one parameter to be controlled.

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 06 December 2011 at 9:05am

Assuming I do put everything in a map file. How do I make sure the query string is read correctly?
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 07 December 2011 at 3:16am

What do you mean?
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 08 December 2011 at 11:38am

I would like to find out why I can't  get the query string. Instead of the query string I get item_category=${revmapfile:}.
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 09 December 2011 at 4:47am

Try using item_category=${revmapfile:$1} istead of item_category=${revmapfile:}

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 09 December 2011 at 9:36am

Great! That worked.

This is what I have :

Code:

RewriteEngine on
RewriteBase /

RewriteMap mapfile txt:mapfile.txt
RewriteCond %{QUERY_STRING} (.+)
RewriteCond ${mapfile:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^search\.cfm$ ${mapfile:%1}? [NC,R=301,L]

RewriteMap revmapfile txt:revmapfile.txt
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${revmapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(.+)$ /search.cfm?${revmapfile:$1} [NC,L]

How do I add the following to a rule
Code:

fssearch.cfm?item_category=FEB&offset=1
to Facets-Eternity-Bands/Page/1

I tried adding
Code:

RewriteRule ^fssearch\.cfm$ ${mapfile:%1}? [NC,R=301,L] and then
RewriteRule ^(.+)$ /fssearch.cfm?${revmapfile:$1} [NC,L]


for each rule but then both rules don't work.


Edited by edba1970 - 09 December 2011 at 11:48am
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 12 December 2011 at 4:03am

you don't simply add... you need to create a separate rule:

RewriteMap mapfile txt:mapfile.txt
RewriteCond %{QUERY_STRING} (.+)
RewriteCond ${mapfile:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^fssearch\.cfm$ ${mapfile:%1}? [NC,R=301,L]

RewriteMap revmapfile txt:revmapfile.txt
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${revmapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(.+)$ /fssearch.cfm?${revmapfile:$1} [NC,L]

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 12 December 2011 at 2:08pm

I got it working. I didn't think that I also had to create new mapfiles for new rules.

I am having a bit of a problem. When I define this rule
Code:

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]

which works great. However having images which are displayed in the same form as the code above, assumes that I am trying to define a rule. For example, suppose I want item.cfm?item_name=Blabla&item_id=700 to be shown like so \Blabla\700.html. So now any directory that looks like a modified version will no longer work. If I have an image that is located in \images\image1.jpg, it will try to execute a rule instead of displaying the an actual image. Does this make any sense?


Edited by edba1970 - 12 December 2011 at 2:10pm
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 13 December 2011 at 6:12am

use the following conditions

RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d

in front of

RewriteRule ^([^/]+)/([^/]+)$ /item.cfm?item_name=$1&item_id=$2 [NC,L]

Regards
Andrew
Back to Top
 
edba1970
Newbie


Joined: 10 November 2011
Location: United States
Posts: 24
Posted: 13 December 2011 at 12:57pm

I tried the code but it doesn't change anything.
Back to Top Visit edba1970's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 15 December 2011 at 8:09am

Please, provide the rewrite.log for the testing request than.
We need to see what's happening.

Regards
Andrew
Back to Top
 

<< Prev Page of 3 Next >>
 
Printable version Printable version