Sometimes you want visitors to one domain to be redirected to another automatically. The most common reasons are: you have changed your company name and bought a new domain, you have several domains that should lead to the same website, or you want to redirect the .com version to the .hr version.
Method 1: Redirect via cPanel #
This is the simplest way if both domains already point to the same hosting.
- Log in to cPanel
- In the Domains section, click Redirects
- Set up the redirect:
- Type: Permanent (301) — for a permanent redirect (recommended for SEO)
- https?://(www.)?: choose the domain you are redirecting
- Redirects to: enter the full URL of the destination (e.g.
https://www.nova-domena.hr) - www. redirection: choose Redirect with or without www.
- Wild Card Redirect: tick this if you want all subpages to be redirected as well
- Click Add
Method 2: A domain without a hosting plan #
Moj WMD has no redirect record, so a domain that is only registered has to be put on hosting first. Add it to an existing plan as an additional (addon) domain and set up the redirect as in Method 1.
Method 3: Redirect via .htaccess #
Advanced users can set up the redirect directly in the .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^stara-domena\.hr$ [OR]
RewriteCond %{HTTP_HOST} ^www\.stara-domena\.hr$
RewriteRule (.*)$ https://www.nova-domena.hr/$1 [R=301,L]This rule redirects all requests from the old domain (with or without www) to the new domain, keeping the URL path.
301 vs 302 redirect — what is the difference? #
- 301 (Permanent) — a permanent redirect. Google passes the SEO value on to the new domain. Use it for permanent changes.
- 302 (Temporary) — a temporary redirect. Google keeps the old domain in its index. Use it only for short-term redirects.
Our recommendation: In most cases, use a 301 redirect. That way Google knows the change is permanent and passes the ranking on to the new address.
Checking the redirect #
Once it is set up, check that the redirect works correctly:
- Open the old domain in your browser — it should take you to the new one automatically
- Use a tool such as httpstatus.io to check that the status code really is 301
Need help with the redirect? Contact us at info@wmd.hr — we will set it up for you.