0

I'm facing an error that is driving me crazy.

I have this directive in my .htaccess:

RewriteRule ^([a-zA-Z0-9_+.\-]*)-barato$ buscar?controller=search&s=$1 [L,QSA,NC]

This directive is for the prestashop search engine. It is not keeping the nice url and is making a 301 redirect to the ugly url instead...

I have tried and searched all. I hope you know how to give me indications of where the fault may be.

UPDATE

Sorry for taking a long time to answer, I've had a brutal work season. I have tried what wp78de said (again, because I think I already tried this too) and it still does not work... This htaccess has been working correctly in prestashop 1.6 for several years. However in none of the versions of prestashop 1.7 (1.7.2, 1.7.3, 1.7.4.1/2/3) in which I have tried it works.

It is a huge headache and surely it is silly, but I do not give with it...

1 Answers1

0

If I understand this correctly, you want to rewrite without redirecting. This requires enabling mod_proxy and mod_rewrite in Apache's httpd.conf.

Then, the rewrite should look like this:

Options +FollowSymLinks -MultiViews 
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_+.\-]*)-barato$ buscar?controller=search&s=$1 [L,QSA,NC]

I've removed the E|ENV flag. It has no purpose here, does it?

Reference:

wp78de
  • 18,207
  • 7
  • 43
  • 71
  • Hello, sorry for my delay. I've tried what you've told me (again, since I think I've already tried this) and it's still not working ... The funny thing is that this works in prestashop 1.6, but in none of my prestashop 1.7 installations does it work ... Either a clean or modified installation. I'm seriously thinking it's a problem with prestashop 1.7, but I can not find the reason either... – Jose Francisco Dominguez Palac Oct 15 '18 at 12:44