| Author |
|
junior Newbie

Joined: 19 August 2009
Online Status: Offline Posts: 15
|
| Posted: 08 December 2011 at 9:20am | IP Logged
|
|
|
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 | IP Logged
|
|
|
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
Online Status: Offline Posts: 15
|
| Posted: 12 December 2011 at 7:06am | IP Logged
|
|
|
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 | IP Logged
|
|
|
Please, provide the one you have so I'd edit it.
Regards
Andrew
|
| Back to Top |
|
| |
junior Newbie

Joined: 19 August 2009
Online Status: Offline Posts: 15
|
| Posted: 12 December 2011 at 7:47am | IP Logged
|
|
|
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 | IP Logged
|
|
|
and what are parameters names?
|
| Back to Top |
|
| |
junior Newbie

Joined: 19 August 2009
Online Status: Offline Posts: 15
|
| Posted: 15 December 2011 at 7:42am | IP Logged
|
|
|
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 | IP Logged
|
|
|
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
Online Status: Offline Posts: 15
|
| Posted: 20 December 2011 at 8:59am | IP Logged
|
|
|
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 | IP Logged
|
|
|
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
Online Status: Offline Posts: 15
|
| Posted: 21 December 2011 at 10:12am | IP Logged
|
|
|
Thanks for all your help on this, grateful as always
|
| Back to Top |
|
| |