Detour Pro
ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6
Back to this add-on's main page
View Other Add-ons From Tom Jaeger
Is it possible to redirect and keep the ?id= part
Feature Request
tunnel7
|
Posted: 02 October 2015 05:26 PM |
|
|
|
Hi Mike ... I was reading the documentation and I’m close but not quite there, thus the request.
The scenario is I am attempting to redirect:
os/reset_password?&id=BrzVdZhw
to
/reset-password?&id=BrzVdZhw
I was attempting to do this with using the single and double & wildcards and it will work but no matter what I try it chops the ?&id=BrzVdZhw off of the redirect.
Is this possible to keep this part in the redirect using the module?
Thanks in advance.
|
|
|
cityzen
|
Posted: 02 October 2015 05:30 PM |
# 1
|
|
|
Hey there -
Currently Detour doesn’t support keeping the query string but let me see what I can do to add that in. Can I loop back around with you on Monday?
Thanks,
Mike
|
|
|
tunnel7
|
Posted: 02 October 2015 05:31 PM |
# 2
|
|
|
Of course. That would be great. Much appreciated.
|
|
|
tunnel7
|
Posted: 06 October 2015 10:57 AM |
# 3
|
|
|
Hi Mike. Any word / update on this? Thanks in advance.
|
|
|
cityzen
|
Posted: 06 October 2015 11:08 AM |
# 4
|
|
|
Yea, I’m testing a way to do this w/out touching the control panel. Thinking about allowing you to add a ? at the end of the redirect to that would indicate you want the query string on there. Would that work?
|
|
|
tunnel7
|
Posted: 06 October 2015 11:17 AM |
# 5
|
|
|
Yes, I think something like that would work fine. I just need from the ? on to stay on the redirected URL. Thanks for the quick reply. Will look forward to hearing how it turns out.
|
|
|
cityzen
|
Posted: 06 October 2015 11:23 AM |
# 6
|
|
|
can you shoot me an email to mike [at] cityzen.com with your ext.detour_pro.php file. Would you be willing to test on your site after I do some local testing?
|
|
|
tunnel7
|
Posted: 06 October 2015 12:31 PM |
# 7
|
|
|
As long as you make a backup of the existing file so if something does go haywire we can easily put back in place, I’m fine with that. Will send email now.
|
|
|
cityzen
|
Posted: 06 October 2015 05:49 PM |
# 8
|
|
|
I just realized that this should all work fine with the existing ability to include the tail of the redirect. If you want to download the latest version (1.5.1) and set up your redirect like this:
original URL:
os/reset_password%%
detour to:
reset-password
but you also need to go into the Extension settings and set Default URL Detection Method to PHP:
Screenshot: https://www.dropbox.com/s/9posq2bb4018n9u/Screenshot 2015-10-06 17.48.40.png?dl=0
I just tested it locally and it works as expected.
Sorry for the delay on that!
Mike
|
|
|
tunnel7
|
Posted: 07 October 2015 09:53 AM |
# 9
|
|
|
OK. Thanks Mike. I will get to this later today and will let you know how I make out.
|
|
|
cityzen
|
Posted: 07 October 2015 09:54 AM |
# 10
|
|
|
No problem. I thought I recalled at some point that there was an issue with query strings but then tested with your example and it worked. You do have to set it to PHP, though.
Let me know how it works out.
|
|
|
tunnel7
|
Posted: 07 October 2015 07:39 PM |
# 11
|
|
|
This did the trick! Thanks for pointing me in a good direction here.
|
|
|
cityzen
|
Posted: 07 October 2015 09:53 PM |
# 12
|
|
|
Awesome, glad it worked!
|
|
|
tunnel7
|
Posted: 08 October 2015 09:09 AM |
# 13
|
|
|
It’s great to have this in place.
|
|
|
Ottergoose
|
Posted: 23 February 2016 01:33 PM |
# 14
|
|
|
I was able to get the query strings working by adding this at line 67 of detour_pro/ext.detour_pro.php v 1.6:
// If a query string is present, append it to new URL if(isset($_SERVER["QUERY_STRING"])){ if($_SERVER["QUERY_STRING"] != ''){ $newUrl .= '?' . $_SERVER["QUERY_STRING"]; } }
This doesn’t require modifying any of the redirect rules, nor enabling the URL detection method in the CP (which didn’t seem to work for us).
It works in my test environment anyways, FYI/FWIW.
|
|
|