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 Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
junior
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 15
Posted: 08 December 2011 at 9:20am | IP Logged Quote junior

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 View junior's Profile Search for other posts by junior
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 12 December 2011 at 5:27am | IP Logged Quote Guests

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 View Guests's Profile Search for other posts by Guests
 
junior
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 15
Posted: 12 December 2011 at 7:06am | IP Logged Quote junior

Hi Andrew,

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


Back to Top View junior's Profile Search for other posts by junior
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 12 December 2011 at 7:38am | IP Logged Quote Guests

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

Regards
Andrew
Back to Top View Guests's Profile Search for other posts by Guests
 
junior
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 15
Posted: 12 December 2011 at 7:47am | IP Logged Quote junior

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 View junior's Profile Search for other posts by junior
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 15 December 2011 at 3:37am | IP Logged Quote Guests

and what are parameters names?
Back to Top View Guests's Profile Search for other posts by Guests
 
junior
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 15
Posted: 15 December 2011 at 7:42am | IP Logged Quote junior

Sorry, parameter names are date and code.
Back to Top View junior's Profile Search for other posts by junior
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 16 December 2011 at 6:49am | IP Logged Quote Guests

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 View Guests's Profile Search for other posts by Guests
 
junior
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 15
Posted: 20 December 2011 at 8:59am | IP Logged Quote junior

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 View junior's Profile Search for other posts by junior
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 21 December 2011 at 4:18am | IP Logged Quote Guests

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 View Guests's Profile Search for other posts by Guests
 
junior
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 15
Posted: 21 December 2011 at 10:12am | IP Logged Quote junior

Thanks for all your help on this, grateful as always
Back to Top View junior's Profile Search for other posts by junior
 

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

  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