J
J
juristcomp2014-12-20 21:35:36
htaccess
juristcomp, 2014-12-20 21:35:36

How to implement a redirect in .htaccess?

You need to do the following transformation
juristcomp.ru/index.php?id=3363&product_1=8495&type=3
on
juristcomp.ru/toindex.php?product=363

RewriteRule ^index.php?id=3363&tovar_1=8495&type=3$ toindex.php?product=363 [L]

But as far as I understand, htaccess truncates everything after the question mark. I tried escaping the question marks and adding the QSA flag, but it still didn't work. How to carry out the conversion?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akdes, 2015-02-25
@akdes

I don't see the point in converting. 3363 becomes 363 for you, tovar_1 and type disappear altogether...
for conversion, at least one value is needed, which remains before and after. Or are you only interested in the transformation of this link, there cannot be other IDs?
here ... drove, updated

RewriteEngine on
RewriteRule ^toindex.php?product=363$ index.php?id=3363&tovar_1=8495&type=3  [NC]

In this case, opening "toindex.php?product=363" will actually call index.php?id=3363&product_1=8495&type=3
Only meaning?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question