V
V
Vlad Konohin2021-11-19 11:40:47
htaccess
Vlad Konohin, 2021-11-19 11:40:47

How to set up a site admin redirect?

There was a need to change the site admin url, for example, to move from admin.old.ru to admin.new.ru without transferring the code. As far as I understood from the information in Google, the problem can be solved using redirects by making changes to the htaccess file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Emil, 2021-11-19
@tsukuyomich

Yes, you can make changes to the htaccess file or one of the admin files.
Here are a couple of examples in different languages:
.htaccess with url wrapping

RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

PHP without url wrapping HTTP without url wrapping JS(browser) without url wrapping JS(browser) without url wrapping - option 2 Choose which one suits you best.
header("Location: http://admin.new.ru");
Location: http://admin.new.ru
window.location.href = "http://admin.new.ru";
window.location.replace( "http://admin.new.ru");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question