This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: Including date & code in ISAPI
Author
Message |
junior
Newbie


Joined: 19 August 2009
Posts: 15
Posted: 08 December 2011 at 9:20am

Hi, we've been running your ISAPI successfully for 3 years using a mapfile.

from:
domain.com/sunholidays/index.asp?Season=Summer&Resort=ABC123

to
domain.com/sunholidays/summer/countryname/resortname/hotelname

Is it possible to add a date and code (3 letter airport code) in the new URL? This would then show prices for that hotel for that date/departure.

like this:
domain.com/sunholidays/summer/countryname/resortname/hotelname/departuredate/departureairportcode
Back to Top
 
Guests
Guest


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

I assume you don't want to change mapfile.
Well, we can try to leave what you have as it is and convert the following as:

domain.com/sunholidays/index.asp?[Season=Summer&Resort=ABC123]&date=YYY&code=ZZZ
----> -----> ----->
domain.com/sunholidays/summer/countryname/resortname/hotelname/YYY/ZZZ

This will require only minor changes in the rule.

Regards
Andrew
Back to Top
 
junior
Newbie


Joined: 19 August 2009
Posts: 15
Posted: 12 December 2011 at 7:06am

Hi Andrew,

Would prefer not to change the mapfile. Think your suggestion would work, what would the minor change be?


Back to Top
 
Guests
Guest


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

Please, provide the one you have so I'd edit it.

Regards
Andrew
Back to Top
 
junior
Newbie


Joined: 19 August 2009
Posts: 15
Posted: 12 December 2011 at 7:47am

Thanks Andrew,

Below is the code we currently use:

RewriteRule ^sunholidays/summer/(.+?)/?$ sunholidays/index.asp?Resort=${mapfile:$1}&Season=S [NC,L]

We also have a 301 redirect:

RewriteCond %{QUERY_STRING} Season=S&Resort=([^&]+) [NC]
RewriteRule ^sunholidays/index\.asp$ sunholidays/summer/${revmapfile:%1}? [NC,R=301,L]

many thanks
Back to Top
 
Guests
Guest


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

and what are parameters names?
Back to Top
 
junior
Newbie


Joined: 19 August 2009
Posts: 15
Posted: 15 December 2011 at 7:42am

Sorry, parameter names are date and code.
Back to Top
 
Guests
Guest


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

Try using the following

Code:
RewriteRule ^sunholidays/summer/(.+)/(.+)/(.+)/?$ sunholidays/index.asp?Resort=${mapfile:$1}&Season=S&date=$2&code=$3 [NC,L]

RewriteCond %{QUERY_STRING} Season=S&Resort=([^&]+)&date=([^&]+)&code=([^&]+)$ [NC]
RewriteRule ^sunholidays/index\.asp$ sunholidays/summer/${revmapfile:%1}/%2/%3? [NC,R=301,L]


Regards
Andrew
Back to Top
 
junior
Newbie


Joined: 19 August 2009
Posts: 15
Posted: 20 December 2011 at 8:59am

Thanks Andrew, that works perfectly.

I want to add another parameter (duration):

Code:
RewriteRule ^sunholidays/summer/(.+)/(.+)/(.+)/?$ sunholidays/index.asp?Resort=${mapfile:$1}&Season=S&date=$2&duration=$3&code=$4 [NC,L]

RewriteCond %{QUERY_STRING} Season=S&Resort=([^&]+)&date=([^&]+)&duration=([^&]+)&code=([^&]+)$ [NC]
RewriteRule ^sunholidays/index\.asp$ sunholidays/summer/${revmapfile:%1}/%2/%3/%4? [NC,R=301,L]


This works when a duration is selected (7 or 14), however sometimes the duration parameter may be blank, in order to show both 7 and 14 durations. This doesn't work when left blank.
Back to Top
 
Guests
Guest


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

The best way is to have one rule without duration parameter and one with it. Don't try to combine those, it's often worse than having 2 rules.

Regards
Andrew
Back to Top
 
junior
Newbie


Joined: 19 August 2009
Posts: 15
Posted: 21 December 2011 at 10:12am

Thanks for all your help on this, grateful as always
Back to Top
 

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

Printable version Printable version
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