Adding in a dynamic date
4 posts
• Page 1 of 1
Adding in a dynamic date
Hi, want to change part of our site that relies on dynamic date being entered in URL (today's date plus 3 days). Is it possible to use something like:
RewriteRule ^flights/ flightsearch.asp?deptairport=XXX&arrairport=XXX&deptdate=040514 [NC,R=301,L]
But to make deptdate=040514 dynamic?
thanks
RewriteRule ^flights/ flightsearch.asp?deptairport=XXX&arrairport=XXX&deptdate=040514 [NC,R=301,L]
But to make deptdate=040514 dynamic?
thanks
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Adding in a dynamic date
Hello,
What do you exactly mean? Get a current date + 3days from somewhere in this exact format? interesting...
What do you exactly mean? Get a current date + 3days from somewhere in this exact format? interesting...
Re: Adding in a dynamic date
Hi Andrew,
If I created a dynamic date (today's date + 3 days = 100514) and dropped it into our current map file, would it be possible to use a RewriteRule as below?
RewriteRule ^flights/ flightsearch.asp?deptairport=XXX&arrairport=XXX&deptdate=100514 [NC,R=301,L]
If so, what would I need to change in order to recognise the dynamic date? Not sure it's even possible, but wanted to ask.
thanks
If I created a dynamic date (today's date + 3 days = 100514) and dropped it into our current map file, would it be possible to use a RewriteRule as below?
RewriteRule ^flights/ flightsearch.asp?deptairport=XXX&arrairport=XXX&deptdate=100514 [NC,R=301,L]
If so, what would I need to change in order to recognise the dynamic date? Not sure it's even possible, but wanted to ask.
thanks
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Adding in a dynamic date
Hm... interesting... lets try:
where, in mapfile, you'd have:
Regards
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^(flights)/$ flightsearch.asp?deptairport=XXX&arrairport=XXX&deptdate=${mapfile:$1} [NC,R=301,L]
where, in mapfile, you'd have:
flights 100514
Regards
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests