Min menu

Pages

SEO Definition of URL Rewriting

URL Rewriting

The English term URL Rewriting refers to a technique which consists of transforming the difficult to read URL of a web page into a clean address, more relevant and more readable for the Internet user. In SEO, this technique makes it possible to indicate to search engines the main keywords of the content of the page concerned. How does URL rewriting work? Why is it useful for your digital marketing strategy? And how to modify your URLs to make them more readable for robots and human users? This article tells you more about it.

Definition of URL Rewriting

When creating a site in a CMS ( WordPress, Joomla or Drupal  for example), the page addresses are created natively in a raw format, often complex and very unintuitive. To simplify them and make them more effective from an SEO point of view, it is necessary to rewrite them. It is this rewriting phase that is called URL Rewriting in English.

What is URL Rewriting?

The term URL Rewriting or URL Rewriting is used to designate a programming technique (or an integrated function of the CMS) which makes it possible to rewrite the addresses of pages on a site, in order to make them more meaningful and more understandable. The principle is simple:  replace the difficult to decipher web addresses of a site with clean and readable URLs .

Indeed, when the pages of a site are generated automatically via content management software, their addresses are generally codified and very insignificant for a human. These often long page links use a very complex format and sometimes include several special characters (=, ?, &) as in the following two examples:

  • http://www.Your-website.com/categorie/product.php?id=10&page=1&article=2
  • https://www.Your-website.com/bolg/?home=articles&id_article=155

Related: Blacklist SEO definition


This type of link is not only incomprehensible to users, but also very difficult for Google's crawlers to classify  . The objective of the rewriting will therefore be to rework the web addresses that follow this format, so that they are more natural in the eyes of Internet users and search algorithms.

What is the use of URL Rewriting in SEO?

When used on a website, URL rewriting provides huge benefits from an SEO perspective. It allows in particular:

  • To improve the natural referencing of the site
  • To provide a better user experience
  • To help robots and spiders to better understand the URLs of the site

Improve your natural referencing

One of the main advantages of URL rewriting is that it actively contributes to the natural referencing of sites. To be well referenced on Google, it is important that your page addresses are stable, readable and understandable. The links generated automatically by the CMS not being in conformity with these criteria, it is essential to rewrite them to have more chances of success.

When the addresses of your articles are simple and intuitive, this sends positive signals to the algorithms of the engine which consider that your URLs are relevant. Indeed, the rewritten URLs generally contain keywords that inform the engines about the theme of each article. This allows robots to  better categorize the site for better rankings .

Deliver a better user experience

Apart from its involvement in SEO, URL Rewriting plays a key role in optimizing the user experience  SXO  (search experience optimization). When the addresses of your articles are readable and easy to understand, it attracts more attention from Internet users. They can quickly get an idea of ​​the content of your article by reading the link of the page. This greatly improves the user experience.

Help search engines understand your URLs

As is the case for Internet users, rewriting your URLs makes it  easier for search engine robots to read them . Indeed, when a page address contains several complex variables as in the case of non-rewritten links, reading can take a long time for crawlers. In most cases, the latter abandon the crawling of the URL concerned, regardless of the SEO value of its content. The rewrite therefore makes the task easier and faster for the spiders.

Exemples d'URL Rewriting

To better understand how URL rewriting works, let's take the example of two product pages A and B whose respective web addresses are:

  • https://www.Your-website.com/article.php?id=13&page=5&heading=1
  • http://www.Your-website.com/page/index.php?id=12&page=1&article=5

With these addresses, it is impossible for the user to know what the pages in question are about. Once modified, they will be more mnemonic and more user-friendly. Thus, for pages A and B, this will give for example:

  • https://www.Your-website.com/categories/mens-shoes/city-shoes
  • http://www.Your-website.com/interior-decoration/furniture/canape-scandinave-blue

Through these addresses, we can logically understand that page A is dedicated to men's dress shoes, while page B presents a Scandinavian-style blue sofa.

What are the steps of URL Rewriting?

Want to change your site's link structure to make it easier for Google and your visitors to read? This technical intervention requires following several steps. These include in particular:

  • Check if your host allows the use of the URL Rewriting function
  • Define the link schemes you want to use
  • Set up your RewriteRule
  • Apply changes to all links on your site
  • Update your site

Check if your host allows URL Rewriting

Before embarking on the URL Rewriting procedure, you must first check if your host allows the use of this function. Indeed, the module for applying changes may differ depending on the type of hosting you use. In the case of hosting on a dedicated server, for example, it is often easy to access the configuration files to activate mod_rewrite. On the other hand, this type of intervention can be difficult, even impossible when the site is hosted on a shared server.

To check if you can use it, create a directory called "test" in the root of your site, at http://www.your-site.com/test/. Within this directory, create a page named "test.html" (http://www.your-site.com/test/test.html) containing only the following code:

< html >
< head > < title >Test </ title> </ head >
< body > This is a verification </ body >

</ html >

Then, create a second file named “.htaccess” containing the code:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^essaie.html$ /test/test.html [L]

As soon as this is done, place the two files in the root of your site via the FTP transfer module (File Transfer Protocol). Finally, enter the link http://Your-website.com/essaie.html in your browser. If the page displays the text "  This is a verification  " with the URL /try.html in the browser's address bar, then your server allows the use of URL Rewriting. Otherwise, if a 404 or 500 error message  appears on the screen, this means that your host does not allow this configuration.

Define URL schemes for your pages

Once the verification is complete, you need to define the new URL scheme for dynamic pages. The idea is to have URLs that are clean, user-friendly, readable and understandable. For this, a very effective trick is to use  descriptive links with relevant keywords that promote natural referencing . Also remember to use word separators recognized by Google, the hyphen (“-”) and the period for example. You can also use the slash or slash ("/"), provided that it separates the different folders or categories of files.

To better understand how to do this, consider the following example. Let's imagine that article N°14 of your site describes a Bedside table belonging to category N°4 of Household furniture. To be rewritten, its initial URL product.php?id=14&cat=4 must respect a new scheme. This may look like this:

http://www.Your-website.com/home-furniture/bedside-table-14-4.html

Set up rewrite rules in an .htaccess file

This is about setting up rewrite rules (we are talking about a RewriteRule). These will be useful to tell the server how to interpret the different URL schemes defined in the previous step. The implementation of these rules is done via a .htaccess configuration file for each directory of the site. The latter usually includes the parameters "Options +FollowSymlinks" and "RewriteEngine on". These two commands should only appear once in each .htaccess file.

In principle, the “Options +FollowSymlinks” statement is optional. However, it can be used in certain configurations, in particular to create symbolic links in the root of your site towards other files. On the other hand, the “RewriteEngine on” parameter is essential. It is this statement that tells the server that you want to use the URL rewrite module .

Apart from these first two parameters, the rest of the .htaccess file is made up of a series of rewrite rules. Each of these rules is written on a single line, respecting the format:

  • RewriteRule URL_TO_REWRITE URL_REWRITE

This format consists of three different parts:

  • RewriteRule which is a keyword indicating that this is a rewrite rule
  • URL_TO_REWRITE, i.e. the "proper" address you want to assign to the page
  • URL_REWRITE, i.e. the address of the page as it is present on the server

Additionally, each written rule may be preceded by a comment line that begins with the pound sign (#). This line is completely ignored by the URL Rewriting module. However, it allows you to add small descriptions to each rule defined to make the file more understandable.

 

Modify all your links whose URL has been modified

At this stage, you must check that each link on your site uses the correct URL scheme, the one you applied through the RewriteRule. Indeed,  the instructions in the .htaccess file alone are not enough to ensure that all the links on your site are in the new format , with clean and understandable addresses. You will need to change all the hypertext links that refer to documents whose URLs have been rewritten. The same work must be done at the level of the sitemaps, to avoid possible errors which could prevent the exploration of the links.

Update your website and make changes if needed

As a last resort, you should update your site and check how URL rewriting works. To do this, you must transfer all the modified files to the root of your site using the transfer protocol. As soon as this is done, access your site through a browser using the clean URL and check if the page is displayed. In case of 404 or 500 type errors, you will have to make the necessary changes and try again. An effective solution will be to scan the site with URL checking software . This makes it easy to detect broken links or those that don't lead to any HTML document.

In summary, when associated with a good natural referencing strategy, URL rewriting or URL Rewriting can help to better position a site on Google or other search engines. However, the implementation of this technique requires several steps and a good knowledge of the configuration parameters of the servers. To avoid any unpleasant surprises, it is therefore preferable to call on a professional webmaster or a specialized web agency.

Comments