Hi David, Hope all is well
I have implemented the SEO friendly URL tweak as found elsewhere on these forums which gives me a url like this:
http://www.********.co.uk/search/relevance/keyword/
or
http://www.********.co.uk/search/relevance/keyword/3.html
However - as I want to remove the "order by rating" link and just have items shown by relevance is it possible to remove the "relevance" word from the url??
As you probably know - the shorter the url path the better when dealing with search engines
so i would prefer simply
http://www.********.co.uk/search/keyword/
and
http://www.********.co.uk/search/keyword/3.html
Thanks in advance
Robi
Hi David,
I did that but it didnt work.
My .htaccess now looks like this
RewriteRule ^search/(.*)/$ search.php?sort=$1&q=$2&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^search/(.*)/(.*).html$ search.php?sort=$1&q=$2&page=$3&rewrite=1&%{QUERY_STRING} [L]
However - when I search for anything the "relevance" path is still present in the url so no results are returned like below
http://www.*********.co.uk/search/relevance/keyword/
I tried removing it from the url to give me
http://www.**********.co.uk/search/keyword/
But this also returned no results (just a blank page)
Also - I dont want to get rid of the "sort by price links" - just have the site sort by relevance as usual and remove the sort by rating option.
Hope this makes sense.
I will have a play round - I guess the URL is also set in the code somewhere??
Regards
Robi
Hello Robi,
Sorry - yes there must be a redirect to .../relevance/..., probably at the top of search.php. If it's done there, try just removing it...
If not, feel free to email me your search.php and i'll take a look for you...
Cheers,
David.
Hi Robi,
Sure - it should just be a case of changing the rewrite rules to just:
RewriteRule ^search/(.*)/$ search.php?q=$1&rewrite=1&%{QUERY_STRING} [L]
RewriteRule ^search/(.*)/(.*).html$ search.php?q=$1&page=$2&rewrite=1&%{QUERY_STRING} [L]
To remove the sort by links from the search result page, look for the following code on line 147 of search.php:
$banner["h3"] = translate("Order by").": ".$sortRelevance.$sortRating." | ".translate("Price").": ".$sortPriceAsc.", ".$sortPriceDesc;
...and just comment out or delete it.
Cheers,
David.