V
V
Vladimir Homenok2015-11-20 22:48:48
PHP
Vladimir Homenok, 2015-11-20 22:48:48

How to write a catalog in PHP with SEO optimization?

Good evening!
Now I am creating a self-written engine for an online store. The question arose of how to implement the catalog: on many sites, the product page is located at the link domen.ru/catalog/company/model/. But if there are more than 100 products, then this is already more than 100 folders, which will be very inconvenient for editing. How to make sure that the necessary urls are transferred to the right place? I was thinking of making it a 404 redirect followed by a php script parsing the url. But wouldn't a 404 on every page be bad for SEO?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2015-11-20
@MrHamster

You need to do the routing in code, not on the web server.
See how to do it right here: symfony.com/doc/current/book/routing.html

A
Alexey, 2015-11-21
@dzheka3d

Why connect some extra scripts when a person wants to write a self-written engine?
You can do it much easier:
in htaccess something like this is written:
RewriteRule ^([az]{3,20})/([az]{3,20})/([az]{3,20})/$ /index.php?catalog=$1&firm=$2&model=$3
And then in php catch $_GET and pull out what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question