setting up a system for 301 redirect code example
Example 1: redirect 301 htaccess
redirect 301 /url_antigua.html http://www.dominio-nuevo.com/url-nueva/
Example 2: 301 redirect http to https
#For apache .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]