Home WebServer PanelcPanel How to redirect old domain to new domain with .htaccess file

How to redirect old domain to new domain with .htaccess file

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In some cases, you will need to the redirection of the old domain name to the new domain name. In this tutorial, AZDIGI will show you how to redirect domains via .htaccess file on the cPanel hosting.

Step 1: Log in to hosting/VPS and go to the root directory of that domain

chrome LnDfE3eJoX

Because the .htaccess file is a hidden file, you need to Show Hidden Files.

chrome RjbXJd4jrP6

Step 2: Add the following code to the .htaccess file

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://nhập-vào-tên-miền-của-bạn/$1 [R=301,L]

Note: Replace domain-moi.com with the domain you need to redirect to.

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign