Permanent redirection from an old web page to a new web page. How to make Google know it


Home > Blog > SEO
Published on 22 February 2023


Permanent redirection from an old web page to a new web page. How to make Google know it

Definition of web page redirection

Every website has old content that is no longer relevant or useful. When updating a website, old pages should be permanently removed and redirects created to direct old pages to the new page. After updates are complete, search engines update their indexes with the new web page and old web pages will no longer appear in search results. This is called web page redirection and it makes websites more accessible and ensures visitors find the information they're looking for.

When a web page is deleted, Google will redirect previous visitors to the delete page. This temporarily disables old links so that new visitors can access new content. It also prevents broken links from affecting search rankings. After web page deletion is complete, search engines create a new index with fresh content and begin crawling and ranking the new pages. They'll also update their references to link to the new pages. Old web pages will then appear in search results again once web page redirection has finished; this is because Google doesn't know where to send users when a web page is no longer available.

Redirecting old pages before upgrading your website

When a website is converted to HTTPS, search engines need time to create a new index with fresh content. During this phase, old web pages are still accessible through redirects, but new web page rankings start to occur after this process is complete. For this reason, it's important to finish redirecting old pages before upgrading your website. Old pages might still appear in search results for a few weeks after updating your website with HTTPS. Web page redirection helps with this as well; it allows you to update your website with HTTPS without losing old content.

The Htaccess File: What Does It Do and What Does It Mean?

Host-based access control (Htaccess) is a powerful web server management initation that has gained immense popularity in recent years. The .htaccess file is used to manage the accessibility of a web server. It is stored in the root directory of the server and can be accessed from the server's configuration page. Every website owner has complete control over his domain in the htaccess file. Basically, the htaccess file is a web server configuration file that provides flexibility, security and customization options to its user.

Every website owner has complete control over his domain in the htaccess file. This means he can turn off or on any feature or functionality he wants for his website.

For instance, if an owner wants to hide a website from search engines, he can do so by adding  and  codes to the htaccess file. In addition, this file can also be used to hide a website from email clients such as Microsoft Outlook from accessing the website's HTML mail. Other uses for the htaccess file include managing site links, managing site errors and managing user access to the server.

The file can also be used to hide a website from search engines. To do this, the  code must be added to the htaccess file. In addition, adding disallow=’all' along with allow=’all' to the file allows all website users full access, while restricting certain IP addresses from accessing all parts of the server. Disabling directory browsing requires adding allow=’all' and deny=’all' to the file.

To permanently redirect old web pages to the new page, you must enter the URL for the new page into your server's .htaccess file. This tells Google and other browsers where to send old visitors when they request an outdated web page. You can also contact your hosting provider and have it add the redirection code for you if you're using a hosting service.

Removing outdated web pages makes websites more accessible and available for current and future users. When deleting old web pages, always make sure that current users are redirected to the newest version of your website with fresh content before updating your website with HTTPS. Also make sure that your server's .htaccess file is updated so that search engines can access new webpages and remove broken links from their indexes, otherwise, your website will look dated even after updates.

Main page crawled by Google will be the canonical page

When Google indexes sites, if it detects that there are several pages with similar content, it tries to determine which will be the main page of all the crawled pages, and this will be the most frequently crawled page in the future, leaving the other pages for much less frequent crawling. The main page crawled by Google will be the canonical page.
To identify a canonical page as the main web page, it must be configured as follows:

  • By means of html code adding the following line inside the header tag "head" of your web page:
    link rel="canonical" href="https://www.example.com"
  • Place in the "sitemap" of your website only the URL of the page that you consider to be the main one and not of the rest of the duplicate pages. Sitemaps are "sitemap.xml" files containing the main URLs of a website and located in the main folder of a website. In the following page we explain better how a sitemap works.

Old web page must also be configured so that it creates the redirection to the main web page

Once the main web page is configured as a canonical page, the old web page must also be configured so that it creates the redirection to the main web page. It should be done as follows:

  1. Configure the page to redirect through a 301 redirect:
    1.  If you are a server administrator and you use apache as a web server, in your main configuration file you must add a 301 redirect line.
    2.  If you share web hosting on an apache server, you must use the ".htaccess" configuration file adding a 301 redirect line. The line to add in the configuration file is:
       Redirect 301 /oldurl.html https://www.example.com/newurl.html
      We can also do the web redirect within the Apache configuration file with the following line: 
      Redirect permanent "/old" "http://example.com/new" 
      In the event that you want to make redirects with more complex URLs and at a general level. You must have the "mod_rewrite" module activated at the Apache server level and write the following lines in the configuration file:
      RewriteEngine on
      RewriteRule "^/service$" "/about/service" [R=301]
      RewriteRule "^/service$" "/about/service" [R]

      In any case, follow the following link to configure Apache for web redirects.
  2. Use a "meta refresh" redirect within the web header of your old web page with a time of 0 seconds:
  3. You can do a redirection on the server at the programming language level, without having to touch the server configuration files. As for example with php through this line of code:
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: http://www.example.com/newurl');
    exit();
  4. - Do not use javascript to make redirections unless you have no other option, since it is not the option recommended by Google.
  5. - If you can't implement any of the above redirect methods, you should add a link to your new page with a short explanation explaining to the users of your page that they have moved to the indicated address. For example:
    We moved! New site!

Redirecting HTTP to HTTPS

HTTPS is a HTTP connection that encrypts data and links to a server. It's intended to increase security and privacy on the web. However, many websites still use unencrypted HTTP connections. This makes it difficult to connect to a website without typing in a password. Most users are unaware of this and won't choose to connect this way. Doing so risks their personal data, compromise their security and access restricted content.

Encrypting HTTP connections makes it impossible for hackers to gain access to your data. This protects sensitive information such as credit card numbers, bank accounts and personal data. Consumers also prefer https over http when browsing. Doing so prevents third-parties from tracking their browsing habits and using that data for marketing purposes. In addition, https makes sure malware can't communicate with your computer or update itself on the web. This stops malicious software from running silently on your system. Without secure HTTP connections, the web is unusable for anyone other than techyots.

Unfortunately, not everyone agrees that HTTPS is necessary or useful. Google now penalizes websites that use non-https connections. They do this because it's safer for users and easier for the tech community to adopt secure web standards. Plus, most modern browsers now default to https when connecting to a website. This happens automatically without user intervention. Even then, some consumers aren't aware of this and choose not to connect securely. Many public computers are still unsecured and unsafe thanks to weak web performance choices.

If you want to redirect your old http page to https the best way to do it is through the .htaccess file located in the main folder of your web site:

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Redirecting dynamic web pages

A dynamic web page is different from a static one in several ways. For one, static pages don't change over time; they remain the same regardless of the current state of the Internet. In addition, static webpages are accessed using a direct connection to the Internet. A dynamic web page, on the other hand, can be accessed through a slow or intermittent connection to the Internet. Most dynamic web pages require an active internet connection in order to function properly as a result.

A dynamic web page has the following form:

https://www.example.com?content=this-is-my-page

This type of web pages is always recommended to put them as if they were static web pages:

https://www.example.com?content=this-is-my-page → https://www.example.com/this-is-my-page

To make this type of redirections the best way to do it is through the .htaccess file of the web server. 

With the following website:

https://www.example.com/blog/page.php?post=this_is_my_web_content

we want to redirect to the website: 

https://www.example.com/post/this_is_my_web_content.

This type of web formatting for URLs will always be positive for better web positioning and higher ranking in the major search engines.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/post/ !-d
RewriteRule ^post/(.*) /blog/page.php?post=$1 [QSA,L]

The explanation of this Apache code can be quickly interpreted as follows:

If it does not find the directory post -d nor the row -f overwrite with RewriteRule the condition inside the folder post. That is to say, we create a fictitious folder post where inside it admits any type of URL created also fictitiously, this URL can be the content that goes after post=*.

 


Tips on SEO and Online Business

Next Articles

Previous Articles