E
E
elailasou2014-10-06 12:24:52
PHP
elailasou, 2014-10-06 12:24:52

How to make CNC in PHP with db field?

There is a page with a product:
sitename/products.php?id=27
Accordingly, the product is pulled from the database by id.
The database has an alias field for each product.
How to make a CNC, pulling alias from the database and bring the url to the form sitename/product_name_27?
What if the alias has completely different names?
sitename/productone
sitename/anotherproduct
Maybe I'm asking a confused question, please help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Gontarenko, 2014-10-06
@dez-fafara

RewriteRule sitename/product_name_([0-9]+) sitename/products.php\?id=$1

you can read here habrahabr.ru/company/sprinthost/blog/129560

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question