I m not able to add cname records at cloudflare

I’m trying to add a ssl certificate using cloudflare after changing nameservers from freenom to cloudflare which was successful. now when i add cname records in cloudflare it gives me this error.

Invalid hostname: Use ‘@’ to represent the root domain.
i have followed all the steps mentioned in webhost tutorial.

It’s telling you the problem, you just need to make the two records like so:

www points to https://yoursite.000webhostapp.com
@ points to https://yoursite.000webhostapp.com

It looks like you’re putting something else instead of @ in the hostname box on the left side for one of the records. Just make one with @ and you’ll be fine.

Thanks its done. how do i change wordpress url with 301 redirects

What do you mean by change the url? Do you want to change it to your new domain address?

I have successfully changed url but now i cant see any thumbnails or fonts. Exploretech.tk

Yes i was asking how to perform 301 redirect from my previous domain so that when people search for my old domain it redirects to new domain.

Hi @haseeb961!

When using Wordpress combined with Cloudflare, it’s better to switch to HTTPS from Cloudflare’s end, not from origin server.

I have changed the WP address from https://* to http://*. Please go to Cloudflare cPanel > Page rules > Create/Add rule > *exploretech.tk* --> Always use HTTPS

Now please clear your browser cache and try loading your site again.

I dont know how to add rule but i have enabled the option for always use https in cloudflare. Will it work now? Also how i should add 301 permanant redirect from old url.

Also how i should add 301 permanant redirect from old url.

No, you won’t need permanent redirect. CF will instruct your browser to redirect automatically.

i have enabled the option for always use https in cloudflare. Will it work now?

Try it this way. If it doesn’t work, you should use a Cloudflare page rule.

Okay is 301 redirect useful if you dont want to lose all the traffic and seo rankig on the old domain.

Hey @haseeb961

You need to redirect from old domain to new domain?

HTACCESS WAY

Add following code to your old website’s .htaccess file if you need to redirect olddomain.com/anyfile to newdomain.com

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com [R=301,L] 

Add following code to your old website’s .htaccess file if you need to redirect olddomain.com/anufile to newdomain.com/anyfile

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

Replace olddomain.com with your old domain and newdomain.com with your newdomain

1 Like