Gossamer Forum
Home : Products : Gossamer Links : Discussions :

change search url result

Quote Reply
change search url result
Is there a way to use the search in link sql so the search returned answer with clean url. So if I search for term in the site the url will be like html page?

Last edited by:

nir: Oct 6, 2004, 7:37 AM
Quote Reply
Re: [nir] change search url result In reply to
You mean like the below?

http://gadgets-shopping.com/ (very bottom of the page).

I've set the SearchLogger Plugin up on this site, which I then use to show the direct links (great for getting Google to deep-spider your products).

Basically, the way I do it, is;

<%build_root_url%>/search/<%cleanup_query($query)%>

Then, make a new global (called cleanup_query) ... with the following;

Code:
sub {

my $code = $_[0];
$code =~ s/([\x{80}-\x{FFFF}])/'&#' . ord($1) . ';'/gse;
return $code;

}

... and then, set up something like this in a .htaccess file;

Code:
RewriteRule ^search/.* /cgi-bin/links/search.cgi?query=$1 [L]

Hope that helps ... was meant to be going out 5 mins ago ... so I'm afraid thats as detailed as I can give Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] change search url result In reply to
Hi Andy,

Thanks for the great post, Man.. you don't quit to surprise :)

Can you tell me how to fix/update the space with (-) in
http://www.gadgets-shopping.com/search/carbon%20brushes so it would look like
http://www.gadgets-shopping.com/search/carbon-brushes

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] change search url result In reply to
Quote:
Thanks for the great post, Man.. you don't quit to surprise :)

Angelic

Quote:
Can you tell me how to fix/update the space with (-) in
http://www.gadgets-shopping.com/search/carbon%20brushes so it would look like
http://www.gadgets-shopping.com/search/carbon-brushes

Unfortunatly you can't (at least not without some quite big hacking).

Basically, due to the way that the mod_rewrite simply "passes" the query along to search.cgi ... there is nowhere that can replace - with " " (AFAIK).

If I was to do this on my site... I would modify the global that is used to show the SearchLogger top results, so that it does;

$query =~ s| |-|gi;

.. but, like I said ... the - holds value in a search, thus if you called;

http://www.gadgets-shopping.com/search/carbon-brushes

...woudl translate to;

http://www.gadgets-shopping.com/cgi-bin/search.cgi?query=carbon-brushes

(i.e with the - still in it).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] change search url result In reply to
Hi Andy, thanks for the tip.

On the first page of the search results I do get a clean path, such as
http://www.gadgets-shopping.com/search/paris
But the second page has a messy path such as
http://www.gadgets-shopping.com/search/search.cgi?query=paris;isValidated=Yes&nh=2
What can I do to get a clean path like the one of the first page that will look like this:
http://www.gadgets-shopping.com/search/paris-2

I saw that you can't download the SearchLogger Plugin from the plugin page. Where can I find it?
Quote Reply
Re: [nir] change search url result In reply to
Quote:
http://www.gadgets-shopping.com/search/search.cgi?query=paris;isValidated=Yes&nh=2

Mmm... you would need to edit the <%next%> and <%prev%> tags (not too easy).The first page should be all you need, as it gives Google (and other spiders) something to feed on Smile

I'll post more info as i develop this futher (I'm always trying to increase my SE rankings =)).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] change search url result In reply to
Ok, thanks, I'll wait for the next and the preview.
Where can I find the SearchLogger plugin?
Quote Reply
Re: [nir] change search url result In reply to
Quote:
Where can I find the SearchLogger plugin?

Should be able to download it from Plugins > Plugin Download > List All > (keep clicking "Next 10", until you see it listed).

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] change search url result In reply to
Hi Andy, in my site the LinkSql is installed in the dir folder and the search.cgi page is in this folder and not the cgi-bin.
I changed the path
RewriteRule ^search/.* /cgi-bin/links/search.cgi?query=$1 [L]
To
RewriteRule ^search/.* /dir/search.cgi?query=$1 [L]

But when I enter a query, the search engine does not present result but shows the default page of the cgi (as if no results were found, although the regular search shows that there are results). Is there another change I should make because the search is in the dir folder?
Quote Reply
Re: [nir] change search url result In reply to
Mmm... I'm not quite sure what you mean.

Does your folder setup look something like;

public_html/
public_html (root of the site)
public_html/dir
public_html/dir/admin (LSQL admin folder)

? If so, try;

RewriteRule ^search/(.*) dir/search.cgi?query=$1 [L]

(not the missing / in front of "dir").

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Oct 8, 2004, 9:18 AM
Quote Reply
Re: [Andy] change search url result In reply to
My problem with the path is this- I get a path that looks like this
http://www.mysite.com/dir/search/ that gives me the search form of the cgi.
But when I write something else such as http://www.mysite.com/dir/search/shoes or another search term, I still get the search form instead of results. How can I get to the search results through this style of path?
I really appreciate your help J
Quote Reply
Re: [nir] change search url result In reply to
Mmm... you sure there should be results for "shoes" ?

Another way to try it, is change the [L] to [R] , which should "redirect" to the page (and show you the URL that its redirecting to).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] change search url result In reply to
It redirect me to the "search.cgi?query=" all the time.
Quote Reply
Re: [nir] change search url result In reply to
Sorry, should have spotted this earlier :(

RewriteRule ^search/.* dir/search.cgi?query=$1 [L]

...should be;

RewriteRule ^search/(.*) dir/search.cgi?query=$1 [L]

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] change search url result In reply to
It works, thanks Andy, you're the bestWink
Quote Reply
Re: [nir] change search url result In reply to
No worries =)

I've updated the original post, with the new mod_rewrite code (to avoid any future confusion that may occur ;p).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!