Answer the question
In order to leave comments, you need to log in
Bitrix: how to change addresses from ID to text CNC for a well-indexed site?
There is a site with a trade catalog, which is implemented not as a complex component, but on separate files: index.php, sections.php?SECTION_ID=X, detail.php?ELEMENT_ID=Y&SECTION_ID=X
You need to make a CNC like /#SECTION_CODE#/ and /#SECTION_CODE#/#ELEMENT_ID#
The simplest possible solution is to make a complex component based on existing templates (work for a couple of hours). But then everything will be bad with previously indexed pages ...
I see the easiest option - to make a complex component, and in the old sections.php and detail.php files, pull out the category code with a simple request to the database and redirect with a 301 redirect to new addresses.
The question is actually this - all the googled materials contain vague hints that they say a real Bitrix specialist can do this - just spit, and everything is done without deep diving into the code, only through setting up address processing rules. So I'm thinking - maybe someone here will share this very secret knowledge? The ambush is that ID is used in current addresses, and CODE (text alias) is needed in the final ones. Therefore, simply using mod_rewrite will definitely not work ...
Answer the question
In order to leave comments, you need to log in
A soft transition to new urls is best done through "canonical". I explain: you need to replace all links on the pages with a new version of the urls, but the pages themselves must be accessible both at the new and at the old address (I can’t tell you how to do this on Bitrix, I’m not special in this). This is done so that indexed pages in search engines do not become broken. Then you need to add canonicals to both old and new pages, here is a Google article - googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.htmland search engines re-indexing pages will gently replace old urls with new ones in the index. When this happens completely, you track it by statistics, by viewing "site:yourdomain.com" (for Google) and by logs (just by searching), then you can turn off the old urls altogether. Additionally, you can hang a 301 redirect or a soft redirect via javascript (this is how Bitrix is better from the technological side). In order for the site to be quickly reindexed, you can create an RSS or sitemap of the site with new URLs and some recent . Google will start picking up new pages, determine that they duplicate content with old ones, check the old ones, find canonicals here and there and simply replace the urls in the index (without deleting the old urls from the index and re-indexing).
As tedious as it sounds, manually entering 301 redirects in .htaccess is the surest way. Checked by more than a dozen well-indexed projects.
Look, I really don't get it... in either case, the search engine doesn't re-index the site, it just redirects to a different URL! Only in the case of a redirect, a living person who has visited the site is also redirected to a new URL ... why will it be reindexing, and the canonical - correction? I don’t understand…
Now I’m changing the URLs on the site (not Bitrix, self-written engine) — I just paste the following code on the old pages:
if(!isset($_GET["id"])) {
Header("Location: /rus/dogs/");
exit();
}
$id = intval($_GET["id"]);
$path = '/rus/dogs/'.$id.'/';
header("HTTP/1.1 301 Moved Permanently");
header("Location: $path");
1) Write the rules in urlrewrite for both work options.
Those. so that AND by section.php?SECTION_ID=TEST AND by /TEST/ the same page opens,
so that AND by detail.php?ELEMENT_ID=1234 AND by /product/1234/ the same page opens.
2) Put canonical links on the site so that on the section.php?SECTION_ID=TEST page, the canonical link points to /TEST/, and on detail.php?ELEMENT_ID=1234 to /product/1234/
3) In a couple of weeks, start tolerant redirects - separate sections first (i.e. so that section.php?SECTION_ID=TEST redirects with a 301 redirect to /TEST/, and section.php?SECTION_ID=TEST1 works as before)
4) After a couple of weeks, do a full 301 redirect
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question