All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Full URL in result_page parameter

AboutWout 3 Jul 2011 22:52 idea, complete

Hi Lodewijk,

I just ran into something which I think might make a nice addition to Low Search.

I'm working on a site with a weird URL structure, so I needed Low Search to redirect to a full url (including http://) instead of a relative url (segment_1/segment_2).

I went ahead and added it to my copy, but it is worth considering putting it in the original.

At the end of the catch_search method I replaced this:

// Redirect to page 
$this->EE->functions->redirect($this->EE->functions->create_url($uri));

with this:
if (strstr($uri, 'http://') OR strstr($uri, 'https://')) 
{
// Redirect to full URL
$this->EE->functions->redirect($uri);
}
else
{
// Redirect to page
$this->EE->functions->redirect($this->EE->functions->create_url($uri));
}


It is a very crude and frail solution, but it does what I was aiming for. I guess if you can come up with a more robust way of checking if it's a full URL, it would be way better.

Regards,
Wouter

Replies

  1. Low 4 Jul 2011 08:21

    Hey Wouter,

    That's a good idea. I'll put it on the list of updates. :)

  2. Low 9 Jul 2011 10:58

    Added in v1.0.4!

  3. AboutWout 9 Jul 2011 12:33

    I saw it in the changelog. If I can think of anything else, I'll let you know ;)