Topic: Simple RewriteMap and Rule help needed
|

|
| Author |
|
higgsy Groupie

Joined: 10 December 2004 Location: United Kingdom
Online Status: Offline Posts: 76
|
| Posted: 31 March 2011 at 6:27pm | IP Logged
|
|
|
Hi,
Im just trying out Ape before I can tell whether it meets the needs of a project that were working on. I'm trying to setup a rule, which says:
If the following url is found
http://www.mywebsite.com/products/product-title/
Rewrite the url to /test.asp?Product=<ProductID>
So i tried the following:
RewriteEngine On
RewriteBase
DBDriver odbc
DBDParams "Driver={Microsoft Access Driver (*.mdb)}; DBQ=D:\website\db\db.mdb"
DBDPrepareSQL "SELECT intID FROM tblProducts WHERE strLink = @KEY" getProductID
SetEnv mod_seo
RewriteMap ProductID dbd:getProductID
RewriteRule ^/products/(.*)/$ /test.asp\?Product=${ProductID:$1|NOT_FOUND} [L,NC]
But i always get the error, Too few parameters. Expected 1.
Im passing in a string, and hoping to get back an int. Is this possible?
Thanks
Al
|
| Back to Top |
|
| |
Guests Guest

Joined: 01 October 2003
Online Status: Online Posts: -149
|
| Posted: 05 April 2011 at 3:45am | IP Logged
|
|
|
Hello,
Please, provide information on the build that you have installed and the error code that you get. In case it is not the latest build, please install the latest available, it converts numeral into string and back correctly.
The latest build of Ape can provide logs for this issue. Please, see FAQ (enabling logging is same for ISAPI_Rewrite and Ape)
Regards
Andrew
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
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 can vote in polls in this forum
|