Domain redirecting to a new one after the end of registration

Started by SerenMckay, Jul 23, 2022, 10:40 AM

Previous topic - Next topic

SerenMckayTopic starter

Hello!

Probably a stupid question, but sometimes I'm stupid =)

Generally, there is a domain that, after a while, expires, it, respectively, is either renewed or not =)
It is not obligatory to renew it, simply because it is ugly, etc., but I would like to register a new domain name, and, accordingly, people would get from this old one to the new one.
If the domain is not renewed (paid for), then this is impossible, isn't it?
  •  

justinthomsony

No, It is unfeasible. For the redirect to work, you need access to the domain.
You can't manage what you don't own.
  •  

tinjuashok

Upload the full list of pages, set up redirects and redirect users to the new domain name.
Scan and upload a list of old site URLs using a desktop crawler. This list will be useful to us after installing 301 redirects for verification.
If the site is large, you can limit yourself to uploading pages of sections and several URL cards. This will be enough to check.

Set up a 301 redirect for all pages from the old domain to the new one.
Important! In online stores, product pages bring a large share of traffic, so you need to set up a page-by-page 301 redirect, and not just for the main sections.

To do that , in the file .htaccess on the domain from which you want to redirect users, write:

RewriteCond %{HTTP_HOST} ^site\.com
RewriteCond %{REQUEST_URI} !/robots.txt
RewriteRule ^(.*)$ http://site.org/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.site\.com
RewriteCond %{REQUEST_URI} !/robots.txt
RewriteRule ^(.*)$ http://site.org/$1 [R=301,L]

In that version robots.txt will not redirect. These are paginated redirects, i.e. the page site.com/about will redirect to site.org/about .

Important! When writing code in .htaccess take into account the redirection to the main mirror — the presence / absence of a prefix .www, http or https protocol.
Well, the redirect itself:

RewriteCond %{HTTP_HOST} ^site\.com
RewriteRule ^(.*)$ http://site.org/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.site\.com
RewriteRule ^(.*)$ http://site.org/$1 [R=301,L]

As soon as you do the above, make sure that everything works correctly.
To do that, check the browser and the server's response to redirect the main page and at least several internal ones.
  •