Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Trouble with mapfile Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jhartley
Newbie
Newbie


Joined: 10 July 2008
Location: United States
Online Status: Offline
Posts: 10
Posted: 10 July 2008 at 11:16am | IP Logged Quote jhartley

RewriteEngine On

RewriteBase /

#RewriteMap mapfile

RewriteMap mapfile txt:C:\:mapfile.txt

RewriteMap lower int:tolower

RewriteRule ^([^?/]+)\.asp /test.asp?page=${mapfile:$1}

No matter where i put the mapfile.txt i cannot get it to read the file.  The redirecto works properly but it will not assign it a value.  Please help

Back to Top View jhartley's Profile Search for other posts by jhartley
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 3885
Posted: 11 July 2008 at 2:55am | IP Logged Quote Anton

Please try to use this config:

RewriteMap mapfile txt:C:/mapfile.txt

RewriteMap lower int:tolower

RewriteRule ^([^/]+)\.asp$ /test.asp?page=${mapfile:${lower:$1}}



__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
jhartley
Newbie
Newbie


Joined: 10 July 2008
Location: United States
Online Status: Offline
Posts: 10
Posted: 11 July 2008 at 8:29am | IP Logged Quote jhartley

Thank you for the reply.  Let me give a little more information.  The map file looks like this:

testing  01
testing2  02

If you go to /testing.asp it redirects you to test.asp?page= but it does not appear to read the mapfile.  It does not matter where I put the mapfile on the server, it just will not read it.  The strange thing is that before I installed the full version of 3.1.0.51, i swear it would work.  I cannot be positive of that, but i think it did.

RewriteMap mapfile txt:C:/mapfile.txt
RewriteMap lower int:tolower
RewriteRule ^([^/]+)\.asp$ /test.asp?page=${mapfile:${lower:$1}}

Thanks again!

Jon
Back to Top View jhartley's Profile Search for other posts by jhartley
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Online
Posts: 335
Posted: 11 July 2008 at 9:29am | IP Logged Quote Vyacheslav

Hi jhartley!

We have checked up these rules:
Code:
RewriteMap mapfile txt:C:/mapfile.txt
RewriteMap lower int:tolower
RewriteRule ^([^/]+)\.asp$ /test.asp?page=${mapfile:${lower:$1}}

And all works well.

Please check your permissions according to http://www.helicontech.com/isapi_rewrite/doc/security.htm.

__________________
Kind regards!
Vyacheslav.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
jhartley
Newbie
Newbie


Joined: 10 July 2008
Location: United States
Online Status: Offline
Posts: 10
Posted: 11 July 2008 at 11:05am | IP Logged Quote jhartley

Vyacheslav,

Thanks again. I have checked the permissions, and all seem to be correct.  The script is working to some degree, just not reading the mapfile.  I have given the Everyone, System, IIS_WPG, Users full permission to the file.  Again everything with the rewrite script works with the exception of reading a mapfile no matter where i put it or with any permissions.

Any suggestions would be appreciated.

Back to Top View jhartley's Profile Search for other posts by jhartley
 
jhartley
Newbie
Newbie


Joined: 10 July 2008
Location: United States
Online Status: Offline
Posts: 10
Posted: 11 July 2008 at 1:17pm | IP Logged Quote jhartley

A little more information:

Here the log of my request.

72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (2) init rewrite engine with requested uri /tester.asp
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) Htaccess process request c:\inetpub\webroot\smartsite_dcwebdev_com\website\.htaccess
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (3) applying pattern '^([^/]+)\.asp$' to uri 'tester.asp'
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (5) map lookup OK: map=lower[txt] key=tester -> val=tester
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (5) map lookup OK: map=mapfile[txt] key=tester -> val=2
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) escaping /test.asp?page=2
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) Rewrite URL to >> /test.asp?page=2
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (2) rewrite 'tester.asp' -> '/test.asp?page=2'
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (2) internal redirect with /test.asp?page=2 [INTERNAL REDIRECT]
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (2) init rewrite engine with requested uri /test.asp
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) Htaccess process request c:\inetpub\webroot\smartsite_dcwebdev_com\website\.htaccess
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (3) applying pattern '^([^/]+)\.asp$' to uri 'test.asp'
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (5) map lookup OK: map=lower[txt] key=test -> val=test
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (5) map lookup FAILED: map=mapfile[txt] key=test
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) escaping /test.asp?page=
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (1) Rewrite URL to >> /test.asp?page=
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (2) rewrite 'test.asp' -> '/test.asp?page='
72.84.233.127 72.84.233.127  Fri, 11-Jul-2008  12:52:47 GMT [www.smartsite.dcwebdev.com/sid#315595984][rid#19996312/initial] (2) internal redirect with /test.asp?page= [INTERNAL REDIRECT]
72.

Back to Top View jhartley's Profile Search for other posts by jhartley
 
jhartley
Newbie
Newbie


Joined: 10 July 2008
Location: United States
Online Status: Offline
Posts: 10
Posted: 11 July 2008 at 1:27pm | IP Logged Quote jhartley

I got it.  If you look at the log, tester.asp is redirecting to test.asp?id=2 then test.asp?id=2 is redirecting to test.asp

it is a loop!

 

Thanks to everyone

Back to Top View jhartley's Profile Search for other posts by jhartley
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Online
Posts: 335
Posted: 14 July 2008 at 6:09am | IP Logged Quote Vyacheslav

Hi jhartley!

Yes. It's loop. Excuse me.
Please try this:
Code:
RewriteMap mapfile txt:C:/mapfile.txt
RewriteMap lower int:tolower
RewriteRule ^(?!test\.asp)([^/]+)$ test.asp?page=${mapfile:${lower:$1}} [NC,L]


__________________
Kind regards!
Vyacheslav.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum