Hello! Most of the site’s pages are now with static HTML pages with URLs of this type: www.site.ru/nazvanie-tovara.html. For some requests, the site is in the first position in the search, with the keyword queries are present in the URL pages. Now we are switching to the pages generated by the php script (i.e., there will be only one script, just depending on the URL, it will produce different content). Tell me, please, what is the best way to do it so that during the transition you don’t lose in attendance? And will it not affect the position in the search that we remove from the .html addresses, i.e. let's make a url like www.site.ru/nazvanie-tovara

  • Use mod_rewrite and generate links in the same way as they appeared on a static site - Deonis
  • @Mariya, but what generally makes you abandon the old scheme in the URL? Nobody interferes with the address / product. Html giving all the same as with the address / product in the "new" scheme. Moreover, the ideal option would be to generate pages for products using a CMS, and give them away as static, loading dynamic elements (for example, rating, also bought, basket, etc.) ajax. - user6550
  • I just thought that the lack of extensions would add convenience and security, but, in principle, you can leave the old URL, of course. Pages are already generating cms, at the moment I think how best to implement the implementation of the new system, because the database will be filled gradually, i.e. some kind of smooth transition from static to dynamically generated pages is required. Yes, I am also not well versed in the redirection of pages, while I understand only how to do it, i.e. it turns out that later, when using already dynamic pages, I will need to when accessing the address - masha2
  • www.site.ru/tovar.htm first redirect to a common script that generates html and then somehow issue a static URL again? - masha2
  • one
    You had a link to the static page site.ru/catalog/porsche_cayenne.html. Leave the same link, but redirect all requests to the site's face, where the request processing script is connected. RewriteEngine On RewriteCond% {REQUEST_FILENAME}! -F RewriteCond% {REQUEST_FILENAME}! -D RewriteRule ^ (. *) $ Index.php [L] In this script, parse the URL and issue the corresponding product. - Deonis

1 answer 1

If the search engine receives a 404 error when a page is requested at www.site.ru/nazvanie-tovara.html, it will throw the page out of the index, the position will be lost, the reference weight will also, therefore, the positions will collapse. It will also take time until he finds the page www.site.ru/nazvanie-tovara, adds it to the issue, the reference mass is typed, and only then it appears in the issue, of course not in the top.

In summary, you need to configure the Mod Rewrite with 301 redirects, then the search engine will very carefully glue the pages and there will be no problems.