Read Our SEO POST:
Redirect 301, 302 & SEO Best Practices (with lots of How to)
Learn how to SEO your Website!Tips & Tricks about Content, Local or Technical SEO optimization for every website
Redirection is the process of forwarding both users and search engines from a URL of web page to a different URL on another site or server. 301 redirects are particularly useful, if you’ve moved your site to a new domain, and you want to make the transition as seamless as possible. This is the best way to ensure that users and search engines are directed to the correct page. When doing this, it is critical to observe best practices in order to maintain SEO value.
So, 301 redirect is used for permanent changes, meaning that the url you redirect will no longer be used and thus, you want to send your users and the whole web traffic at another web page.
For cases in which the redirection truly is temporary, a 302 may be the most appropriate. Many hosting and CDN platforms also offer easy redirection management from their admin panels. With a 302 redirect you are telling to search engines, that the URL you are redirecting, will be soon availiable to the users, but for now, they should read or use another temporary web page.
Only use 302 redirects if you intend to return to the original page in the near future, otherwise it is better to use a permanent 301 redirect. For that reason, all SEO value is kept at the older web page and it is not sent to the new address.
Google (and other search engines) have continued to shift focus toward a better user experience, which means they aim to show more reliable, relevant, and high-quality results to users. Now, longer and more comprehensive content that encompasses the topic more in depth are preferred because it provides the user with more information all in one place.
If you decide to rewrite some of your older pages to provide a more comprehensive view of a topic, you can use 301 redirects to transfer the link equity and authority from the existing pages to your newly created or updated website pages.
If you have to delete pages from your site, there are a few things to consider:
Whenever possible, you should always redirect a deleted page to a similar piece of content on your site. If that is not an option, you should consider if deleting the page is the best course of action.
For example, if the page receives traffic and has good quality backlinks associated with it, deleting it could be harmful to your SEO, in which case, it may be worth improving and optimizing the page instead.
301 redirects are particularly useful. It is a server-side redirect. Typing a URL into your browser or clicking on a link sends a request for the page to the server of the website. A 301, “moved permanently,” redirect is a set of instructions which are executed when the request hits the server, automatically re-routing to a different page. You can set up this kind of redirection by adding the appropriate code in your theme’s .htaccess text file.
By using 301 redirects, you will be transferring all of the existing page authority, link equity, and SEO rankings to the new page, thus creating a more powerful page. The scenarios below can be entered into your .htaccess file as shown. The process is simple and convenient.
Before reading further, here is a quick example of a 301 redirection.
Place the following code inside your theme’s .htaccess file, right after the blue snippet :
<IfModule mod_rewrite.c> #if all text in blue exist,
RewriteEngine On
#if all text in blue exist, just insert only the two (-2-) following lines
RewriteCond %{REQUEST_URI} ^/my-category/my-product.html(.*)$ RewriteRule ^(.*) https://www.new-domain.com/new-category/new-product/%1 [R=301,L]
</IfModule> # finalize your code with this text in blue (normally it already exists):
Another quick example:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^old-domain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old-domain.com$ RewriteRule (.*)$ http://www.new-domain.com/$1 [R=301,L] </IfModule>
Redirect 301 /pagename.php https://www.domain.com/pagename.html
Redirect 301 / https://www.domain.com/
Redirect 301 / https://www.domain.com/subfolder/
Redirect 301 /subfolder https://www.domain.com/
Example: If you want a .html extension to use the same filename but use the .php extension.
RedirectMatch 301 (.*)\.html$ https://www.domain.com$1.php
RewriteEngine on RewriteBase / RewriteRule (.*) https://www.newdomain.com/$1 [R=301,L]
RewriteEngine on RewriteBase / rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ https://www.domain.com/$1 [r=301,nc]
RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} domain.com [NC] RewriteRule ^(.*)$ https://www.domain.com/directory/index.html [R=301,NC]
Options +FollowSymLinks
RewriteEngine On RewriteRule ^(.*) https://www.newdomain.com%{REQUEST_URI} [R=302,NC]
Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_URI} ^/subdirname/(.*)$ RewriteRule ^(.*) https://www.katcode.com/%1 [R=302,NC]
Example: The original URL being https://www.website.com/index.php?id=3 and the new URL being https://www.website.com/path-to-new-location/
RewriteEngine on RewriteCond %{QUERY_STRING} id=3 RewriteRule ^index\.php$ /path-to-new-location/? [L,R=301]
Example: The original URL being https://www.website.com/sub-dir/index.php?id=3 and the new page being https://www.website.com/path-to-new-location/
RewriteEngine on RewriteCond %{QUERY_STRING} id=3 RewriteRule ^sub-dir/index\.php$ /path-to-new-location/? [L,R=301]
RewriteEngine on RewriteCond %{HTTPS} on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteEngine On RewriteCond %{THE_REQUEST} /index.php HTTP [NC] RewriteRule (.*)index.php$ /$1 [R=301,L] RewriteEngine On RewriteCond %{THE_REQUEST} /index.html HTTP [NC] RewriteRule (.*)index.html$ /$1 [R=301,L]
Example: The original URL being https://www.website.com/index.php?id=100 and the new page being https://www.website.com/100/
RewriteEngine On RewriteRule ^([^/d]+)/?$ index.php?id=$1 [QSA]
Example: The original URL is https://www.website.com/index.php?category=fish and the new page being https://www.website.com/category/fish/
RewriteEngine On RewriteRule ^/?category/([^/d]+)/?$ index.php?category=$1 [L,QSA]
RewriteEngine on RewriteCond %{HTTP_HOST} ^example-old\.com$ [NC] RewriteRule ^(.*)$ https://www.example-new.com/$1 [R=301,L]
If you do not want to pass the path to the new domain, change the last line to:
RewriteRule ^(.*)$ https://www.example-new.com/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
Example: Redirection from blog.oldsite.com to www.newsite.com/blog/
Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_URI}/ blog RewriteRule ^(.*) https://www.somewhere.com/%{REQUEST_URI} [R=302,NC] RewriteRule ^(.*) https://www.somewhere.com/blog/%{REQUEST_URI} [R=302,NC]
Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)/old-directory/(.*)$ $1/new-directory/$2 [R,L]Related tags:
This website is releted to the term: Search Engine Optimizion (SEO), or otherwise known as Digital Marketing, in English (USA, Great Britain, Ireland, Australia) or Greek!
... Any published article or post on SEO is valid. You can follow any posted recommendations to fix your code in order to get a better score on GTmetrix or PageSpeed Insights. Whenever I find time, I continue developing my website.
Also, if you have a new SEO technique or want to publish a fantastic new SEO strategy online that converts into leads or sales, especially in the e-commerce space, please contact me and I will host your (strictly relative) article, with all proper credits to the author, for at least one month.
Moreover, I will be especially happy if I receive from you an email related to search engine optimization in Greek, which is my native language. Of course, I can provide you with any help you need and it concerns SEO in Greek or creating websites, since I have developed the Wordpress theme that you literally read from scratch. If you are an SEO specialist in Greece, share your opinion with me! So do not hesitate to contact me, I am waiting for you for any advice, question or suggestion to improve my site or anything related to SEO in Greece.
My message in Greek
Θα χαρώ ιδιαιτέρως, αν λάβω από εσάς email σχετικό με search engine optimization στα Ελληνικά, τα οποία αποτελούν τη μητρική μου Γλώσσα. Φυσικά, μπορώ να σας παράξω οποιαδήποτε βοήθεια χρειαστείτε και αφορά SEO στα Ελληνικά ή δημιουργία ιστοσελίδων, μιας και έχω αναπτύξει το Wordpress theme που διαβάζετε κυριολεκτικά από το μηδέν. Αν είστε SEO specialists στην Ελλάδα, μοιραστείτε την άποψή σας μαζί μου! Μην διστάσετε, λοιπόν, να επικοινωνήσετε, σας περιμένω για οποιαδήποτε συμβουλή, απορία ή πρόταση για βελτίωση του site μου ή οτιδήποτε σχετικά με SEO στην Ελλάδα.