txabs Posted September 20, 2017 Share Posted September 20, 2017 (edited) Hi!I need to redirect 302 in Prestashop from a search page to a category. That's because a brand demands me to enter directly in their own category when anyone looks for it. I need Necesito hacer en prestashop una redirección 301 o 302, ya que una marca me exige que al buscar su nombre en el buscador vaya directamente a su categoría. Sería redirigir de una URL tipo:https://midominio.com/buscar?controller=search&orderby=date_add&orderway=desc&search_query=marca&submit_search=redirect to:https://midominio.com/123-marcaI'm triying to do it on htaccess, but can't get it work. Redirect 301 /buscar?controller=search&orderby=date_add&orderway=desc&search_query=marca&submit_search= https://midominio.com/123-marca Could you please help me?Thanks!! Edited October 2, 2017 by txabs (see edit history) Link to comment Share on other sites More sharing options...
ajankuv Posted September 20, 2017 Share Posted September 20, 2017 Did you enable redirects? Options +FollowSymLinksRewriteEngine on Link to comment Share on other sites More sharing options...
txabs Posted September 20, 2017 Author Share Posted September 20, 2017 Hi ajankuv.Sure, i've enabled they. In fact, i have several "normal" 301 redirects from former categories working without a problem. It's just this one with search query which I can't make work.Thanks for your response! Link to comment Share on other sites More sharing options...
ajankuv Posted September 20, 2017 Share Posted September 20, 2017 My best guess is the type of link for the 301 then. Due to it being more of a regex style link you may need to mess around with it. Try posting on stackoverflow for apache/nginx they may be able to assist more. It's more of a server/.htaccess then prestashop issue. Link to comment Share on other sites More sharing options...
txabs Posted October 2, 2017 Author Share Posted October 2, 2017 Finally I solved the issue. I post the solution just in case anyone needs it. As ajankuv said, is more a .htaccess issue than prestashop itself. I just added in .htaccess the following lines:RewriteCond %{REQUEST_URI} ^/buscar$ (it's "buscar" because my site is in Spanish, it's just the search page)!! RewriteCond %{QUERY_STRING} ^controller=search&orderby=date_add&orderway=desc&search_query=[bRAND]&submit_search=$ RewriteRule (.) https://mysite.com/241-[bRAND]? [R=301,L]And duplicate the last two ones with every brand needing the redirection. Thanks a lot mate for your help @ajankuv Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now