Redirect all URL while migrate to new Domain/Halaman

If you plan to migrate to new domain, this article is for you. follow me the steps.

Requirements

  • CloudFlare account.
  • Your domain allready on CloudFlare.

Steps

Go to the cloudflare dashboard and select your old domain.

Navigate to Rules > Redirect Rules.

Click on Create Rule button.

Input your Rule name (required), as example i will input movedomain

When incoming requests match… select All incoming requests

Then in URL redirect input this :

Name Value
Type Dynamic
Expression concat(“http://drama21.cfd“, http.request.uri.path)
Status code 301

 

In Checkbox Preserve query string dont forget to tick it.

Verify redirect works with browse to your old domain name.

Note: Ganti http://drama21.cfd dgn Domain Baru Anda.

Contoh:

 

Bisa mengguukan perintah .htaccess  berikut

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com$ [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *