This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: dbd & RewriteRule troubles
Author
Message |
Kurisotofa
Newbie


Joined: 06 September 2010
Location: Belgium
Posts: 5
Posted: 06 September 2010 at 5:32am

I'm having trouble implementing the correct dbd rules...

I would like to redirect my current URL :
"/en/belgium/page.htm"
...to a new URL-structure :
"/be/page-en.htm"
...where "be" is of course the ISO-code for "belgium".

I have a SQL Server table tbl_Country with fields
"country_name" & "country_code".

So, I guessed my implementation would have been :


DBDPrepareSQL "SELECT [country_code] FROM tbl_Country
WHERE [country_name] = @KEY" Sql_Country_Iso

RewriteMap Map_Iso dbd:Sql_Country_Iso

RewriteRule ^/(en|nl|fr)/([^/]*)/page\.htm
/${Map_Iso:$2}/page-$1\.htm [NC,R=301]

Back to Top Visit Kurisotofa's Homepage
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 06 September 2010 at 6:01am

Hello,
1. Please make sure you’ve set DBDriver and DBDParams properly (http://www.helicontech.com/ape/doc/mod_dbd.htm).
2. Try the following code:

Code:
RewriteMap Map_Iso dbd:Sql_Country_Iso

RewriteCond ${Map_Iso:$2|NOT_FOUND} (.*)
RewriteCond %1 !NOT_FOUND
RewriteRule ^(en|nl|fr)/([^/]*)/page\.htm$ /%1/page-$1\.htm [NC,R=301,L]


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
Kurisotofa
Newbie


Joined: 06 September 2010
Location: Belgium
Posts: 5
Posted: 06 September 2010 at 7:39am

Sorry, Vyacheslav, this doesn't work...

About point 1 : is there a way to monitor if my db-
connection is properly set? I've used the same parameters &
values (Data Source, User ID, Catalog,...) I'm already
using in my ASP code.

About point 2 : "NOT-FOUND" is always returned as the
result of your statement.
Back to Top Visit Kurisotofa's Homepage
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 06 September 2010 at 7:51am

Could you please send the whole configuration of Ape to [email protected] Please also send error.log and rewrite.log files.
Thanks.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 

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

Printable version Printable version