How to make CNC links: step by step instructions

Table of contents:

How to make CNC links: step by step instructions
How to make CNC links: step by step instructions

The world of the Internet is rapidly developing and conquering new peaks. Millions of sites, services and services are happy to accept the next user on their pages. Created a huge number of addresses that are generated automatically. And it is not always convenient to read and remember them. In addition, a meaningless character set is poorly ranked by search engines. As a result, it became necessary to introduce the implementation of the code in such a way that it could appear in a more convenient and pleasing form for the user.

That's why the term CNC links appeared in the world of web development. What it is and how to implement it will be discussed in the article.

What are NC links

In general, CNC is a slang word meaning a human-readable URL. URL is a borrowing from the English URL, a uniform resource locator. Human-readable, in turn, means a set of characters in the address bar that is convenient and easy to read. For example, the generated page address might look like this: It does not look very clear and does not show the structure of the site. There are signs that do not carry a semantic load and it is not clear what the page and name mean.

The following address might look like this: Here it is clear thatwe are talking about products, and new ones, and specifically about a boat. This is the human-readable url. It is much better indexed by search engines and is shown in the search results above the rest. And the person who visited the site will be able to understand that he went to the right section.

cnc links
cnc links

However, NC links have some limitations. For example, Russian characters cannot be used in the address. They are replaced with a numeric value and a percent sign. Therefore, domestic developers use the transliteration of Russian words into Latin. For example, so - oborudovanie or produkcia. Also, an automatically generated NC link can increase the total length of the string.

Special tools are used to implement transliteration and conversion to human-understandable URLs. They are available, as a rule, in content management systems - CMS. The creation of CNC links occurs automatically in them, based on the name of the product, article or blog, as well as the section in which it is posted. As a result, when creating a new record, adding a product, a human-readable URL is formed, which is well perceived by both people and machines.

cnc wordpress links
cnc wordpress links

How to make CNC links in popular CMS

CMS is a content management system that, in a convenient and simple interface, allows you to create a full-fledged website in a short time. The functionality is expanded due to the presence of a large number of ready-made templates, modules and plugins. This allows a person far from the programming languages PHP, JavaScript, HTML and related to them, to quickly create their ownwebsite or blog.

Almost all content management systems have an excellent set of tools in the form of plug-ins for creating CNC. It is worth taking a closer look at the most common of them.

  • WordPress is the most popular content management system, according to statistics. It is installed on most famous blogs and websites. Renowned for being easy to learn and install.
  • Joomla - less popular, but still actively used among developers. It has good functionality, a choice of components, plugins and modules.
  • OpenCart - a separate project for creating online stores. Internally, it resembles any CMS, but is “sharpened” for solving a narrow range of tasks.

CNC links in WordPress - easy to implement

WordPress is probably the simplest content management system. It can greatly simplify the creation of a website or blog from scratch in a short time.

Setting up CNC in WordPress is easy and basically comes down to downloading and installing the Cyr-To-Lat plugin. It is used to convert Cyrillic strings to Latin.

how to make cnc links
how to make cnc links

First of all, you should find it and download it. It is better to do this from the official WordPress site. This way you can avoid the possibility of malicious or advertising code getting into the plugin.

  • After downloading the archive, you need to unpack it.
  • Then move this folder to the wp-content ->plugins section. This is usually done using any available FTP manager.
  • Now you need to go to the admin panelWordPress by entering your username and password.
  • In the "Plugins" section, find Cyr-To-Lat and activate it. The plugin is now installed on the system and enabled.

Next, you need to configure the link structure.

  • To do this, go to "Options", and there go to "Permalinks".
  • In the general settings, there are several templates by which you can build the appearance of the link. It is recommended to use the "Custom" type, which allows you to customize everything as needed. The simplest construct for such a template is /%category%/%postname%/. It means that the category will be displayed in the address bar, and then the title of the post.
  • And then Cyr-To-Lat will convert it all to Latin. As a result, you will get a beautiful and understandable CNC link in WordPress.

In addition to Cyr-To-Lat, you can also use analogues that are present on the official website. For example, these are WP Translitera, ACF: Rus-To-Lat, Rus-To-Lat Advanced. The installation of these plugins is similar, so it makes no sense to dwell on them separately.

CNC in Joomla, several options for creating

Joomla is a slightly more sophisticated content management system. Just like WordPress, it has the ability to create websites and blogs in a short time. It has extensive functionality and flexibility. Next, you need to describe how to make CNC links in this CMS.

Joomla initially has a built-in functionality for creating human-readable urls. CNC links in Joomla 3 can be enabled on the general settings page in the "SEO Settings" section. The item "Enable SEF (CNC)" should beset to "Yes". This will make the links more readable.

cnc links jbzoo
cnc links jbzoo

Here you can additionally set url redirection by creating a CNC link in htaccess. This file acts as the configuration store for the Apache web server. In it, using regular expressions and the RewriteRule directive, you can change the conversion of the link to the desired URL. The main difference of this approach is flexibility. Links can be converted to almost any form.

The item "Append suffix to URL" appends the document extension to the end of the line. For example, html. This extension is of little interest to the average site visitor, so the option can be left in the “No” position.

creating cnc links
creating cnc links

Aliases in Unicode - this item transliterates the name of the material into Latin. This is necessary so that something awkward and unreadable is not displayed instead of Russian letters or other characters.

Alternative components for Joomla

You can also implement a CNC link generator in Joomla using various components. For example, one of the popular ones is JoomSEF. It is distributed free of charge and it is better to download it from the official Joomla website.

In its functionality, in addition to converting urls to CNC, there is a set for generating metadata, search engines, keywords, as well as managing duplicate pages. It is worth noting the existing support for UTF-8 encoding and customizing the 404 page at your discretion.

There are three ways to install in Joomla 3: by downloadingdirectly from a computer, from the site directory and by sending a link to it.

For the first option, the file will have to be downloaded. Then select in the menu of the CMS administrative panel in "Extensions" and go to "Extensions Manager". Using the "Select file" button, you need to show the system the prepared archive and install it.

The second option is rarely used. But the third is the most convenient of them, since it does not require downloading. You just need to copy the link to JoomSEF and specify it in the "Install from URL" field on the tab of the same name. The system itself will check its presence and, if all parameters match, it will install it.

It is worth noting that for the add-on to work properly, it is necessary that the "Enable SEF", "URL redirect" and "Add suffix to URL" items in the SEO settings be set to "Yes".

The installed component will immediately be introduced into the system in active mode and will start its work. Namely, it transforms all existing links into a more aesthetic look.

JoomSEF has a lot of settings and options. With their help, you can very subtly bring all site links to almost any desired form.

JBZoo and human-readable url

The JBZoo component is a universal and powerful tool for creating online stores, catalogs, blogs and just business card sites based on the Joomla content management system.

To install JBZoo in Joomla, it must already have the Zoo add-on.

Sometimes the standard SEF settings don't reach their components to performtransformation. Therefore, to create NC links in JBZoo, it is recommended to use the sh404SEF component. This product is free and is a good link building tool in JBZoo. A large number of settings, functions, support for various social networks and services.

Installation is done by copying the link to the archive, or by directly uploading the previously downloaded file to the server.

OpenCart and CNC setup

OpenCart is a platform without being tied to any content management system. That is, it works separately. Its main focus is the convenient creation of online stores of varying degrees of complexity. Despite the fact that the product itself is free, many add-ons to it are distributed on a commercial basis. The latest stable version is 2.0.

cnc links opencart 2
cnc links opencart 2

CNC links in OpenCart 2 can be generated through manual configuration or using separate modules.

You can start setting up the CNC in the first way by editing the htaccess configuration file of the Apache web server.

  • To do this, go to the site folder via FTP or the file manager available in the administrative memory.
  • The.htaccess.txt file must be in the root directory. Since it has no effect on a system with a.txt extension, the first thing to do is rename it to.htaccess. Now the web server will read its directives and execute them.
  • Now you need to go to the site settings and on the "Server" tab enable the use of CNC.
  • All changesneed to save.
  • Now all links should be transformed.

Sometimes, for some reason, many addresses do not change and remain incomprehensible. To implement this task, you can use the SeoPro component. True, before installing it, you will first have to implement OCMOD Multiline Fix. To do this, you need to manually change the code of one file. It is located at admin/controller/extension/modification.php. To edit it, it is recommended to use the Notepad++ utility to avoid problems with encodings.

links are cnc
links are cnc

You only need to add one line of code to the block after the $limit variable. It looks like this:


Next, you need to find the condition:

  • if (!$limit) {
  • $limit=-1;
  • }

and after it add:

  • if ($quote=='true') {
  • $search=preg_quote($search);
  • }

These files must be saved after modification.

Then you need to actually install the SeoPro module itself. The downloaded archive must be unpacked on the server. Then run a couple of database queries with phpmyadmin:

ALTER TABLE `oc_product_to_category` ADD `main_category` tinyint(1) NOT NULL DEFAULT '0'; ALTER TABLE `oc_product_to_category` ADD INDEX `main_category` (`main_category`);

Now we need to fix the main index.php file. It is interested in the line:


which is replaced by:

  • if (!$seo_type=$config->get('config_seo_url_type')) {
  • $seo_type='seo_url';
  • }
  • $controller->addPreAction(new Action('common/'. $seo_type));

Next, there is a set of procedures related to the settings inside the admin panel. In the menu you need to find "Modules", go to "Modifiers" and click on updates. While here, you need to go to the "Modules" list and install SeoPro in it. Then, by pressing the "Edit" button, go into it and save. After all the manipulations, everything should work, if not, then you should try to reinstall the module again. Or seek help from specialized forums.

Implementation of CNC functionality in PHP

Most of the sites on the Web are written in PHP. It is quite powerful, convenient and easy to learn. Its work is invisible to the user, since the PHP code is processed on the server side and a ready-made HTML page is sent to the browser, which is understandable to the user.

cnc htaccess links
cnc htaccess links

You can show the implementation of CNC links in PHP with a small code example. However, to bring address lines in real multi-page projects to a human-readable form, you will have to tinker.

Any site starts its work with the index.php file. Including generates an appeal to other pages of the site. But first you need to change the htaccess configuration file a bit. You need to specify or uncomment several directives in it, as shown in the photo.

cnc links php
cnc links php

The first line allows you to resolve the URL using the server. The second one sets the base address. The next two lines check for the presence of the file and folder. The latter passes control to index.php if lines 3 and 4 are implemented without errors.

To store the correspondence between the page id and its converted value, we need a table. Therefore, it must be created. In particular, you can create a simple one to understand the process. It will contain two fields: SEF and page_id. SEF stores the name and is of type varchar. And page_id - numbers of pages like int.

Now it remains to fix the index.php file itself. This is just an example, and in practice for a particular project, things can be a little different: $result=$_SERVER['REQUEST_URI']. In this line, the requested url is passed to the $result variable.

if (preg_match ('/([^a-zA-Z0-9\.\/\-\_])/', $result)) { header('HTTP/1.0 404 Not Found '); echo 'Invalid characters in URL'; exit; }

This block checks for the presence of symbols, numbers and some characters. If something other than those listed is present, then a 404 page is issued.

$array_url=preg_split ('/(/|\..$)/', $result, -1, PREG_SPLIT_NO_EMPTY);

The $array_url array is declared here, into which, using the preg_split function, elements are placed that do not have anything extra in the CNC.

if (!$array_url) { $ID_page=1; }else{ $sef_value=$array_url[0];

Here, the request is processed in the case when the request was made not to a specific page, but to a domain. Therefore, you need to send id=1 in response. Also at this placeis meant to query the project database to see if it has the value from the $sef_value variable in the SEF field. If nothing is found, send the user a 404 page. Finally, the resulting address code is processed and the corresponding materials or elements are returned.

Pros and cons of using CNC

The benefits of using human-readable URLs can be listed as follows:

  • link visually looks more aesthetic than a set of obscure characters, especially on unfamiliar sites;
  • remembering the address is much easier;
  • the whole path and site structure becomes clear;
  • GET parameters passed in the normal way use variables in the address bar, which is not the case in the CNC, which means that security is not violated;
  • improving site navigation;
  • SEO-optimization is significantly improved and search robots better index such a site.

There are far fewer drawbacks. And the most significant of them is the setting. It is not always possible to bring page addresses to a human-readable form using standard or third-party solutions. Sometimes you have to delve into the code and edit it yourself, which requires knowledge and time. The second drawback is not so significant and concerns sites with high traffic. Due to the formation of links on the fly, the load on the site increases. But since the cost of network equipment is steadily declining, few people consider such costs for server resources. In general, the advantages far outweigh the disadvantages, so despite the complex implementationhuman-readable urls, it's worth using them.


The article discusses which links are CNC and which are not. The simplest and fastest solutions to the problem were described in detail. As well as some of the most affordable options for complex approaches. In any case, the use of CMS when developing a site significantly reduces labor and time costs when optimizing page addresses. Therefore, the combination of CMS and CNC should be used as the most effective alternative to manual development.

Popular topic

Editor's choice

  • How to block a person in "Contact"? Protect your page from ill-wishers
    How to block a person in "Contact"? Protect your page from ill-wishers

    The popularity of social networks is increasing every day. This is due to the fact that such an instrument of mass communication has entered everyday life and firmly established itself in it, as one of the most convenient ways of communication. Almost every advanced person has his own page on the social network, where he posts his photos, posts posts and, most importantly, communicates with friends and makes new acquaintances

  • Why doesn't "VK" work? The VKontakte website is not working: what to do?
    Why doesn't "VK" work? The VKontakte website is not working: what to do?

    Social media addiction is considered one of the most serious cyber diseases. Every day, tens of millions of users around the globe visit their personal accounts, chatting with friends, discussing the latest events in the world. Social networks have become such a dense part of our lives that it seems unusual to spend a day without looking at them even for a second

  • What is button accordion? Learn slang online
    What is button accordion? Learn slang online

    The Internet is a territory with its own rules, language, style of communication, and, more recently, laws. It so happened that many new users may be left at a loss after communicating with hardened Internet - "hacks". We are talking, first of all, about the use of slang by the latter in their language, which is far from accessible to everyone who opened the page of any forum for the first time

  • Hashtag - what is it? How to use hashtags
    Hashtag - what is it? How to use hashtags

    The Internet is constantly progressing, and every day new features appear in it that make working on it more convenient. They are associated, as a rule, with the optimization and structuring of information, since there is such a large amount of it on the World Wide Web that it is sometimes difficult to find the necessary material. For example, in the recent past, so-called hashtags appeared

  • Why is the internet slow? The most important reasons
    Why is the internet slow? The most important reasons

    In the last couple of years, the Internet has become an important part of the life of almost every person. Using the World Wide Web, we can find out the weather, the latest world news, download the necessary programs, play online games, etc. When the Internet is working well, doing the above things is very nice, but what if all of a sudden web pages start to load for a very long time, and online games slow down?