M
M
Mark Simonov2016-01-18 17:54:53
PHP
Mark Simonov, 2016-01-18 17:54:53

Create a redirect for a site link request?

I make a request to a site with a specific ID => site.com/product.php?id=55
Data is processed in the tovar.php file, during which, thanks to the received ID, several parameters are assigned certain values ​​from the database. That is, artikul=1, brand=sonka.
I want to make links more readable. In htaccess I write RewriteRule ^tovar/(.*).html$ tovat.php?id=$1 Now the request to the site looks like site.com/product/55.html The
question is how to make the correct link so that you can go directly by already known values ​​site.com/sonka/1.html
If anyone has any suggestions, thanks in advance!
How correct is the method, how will search engines react? For example, I suppose that after the entered ID, it is possible to write the received values ​​into the link site.com/tovat.php?brand=$1&artikul=$2, then redirect to
RewriteRule ^(.*)/(.*).html$ tovat.php?brand =$1&artikul=$2

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question