DNS records to redirect everything to another domain - dns

I have several domains:
example.co
example.io
example.com
I want to redirect everything from .co and .io to their counterparts in .com, which means:
sub.example.co => sub.example.com
api.example.io => api.example.com
example.co => example.com
...
I've heard about DNAME records, but cloudflare do not support them.

If you just mean normal url forwarding, according to this link, you just have to:
Log into your Cloudflare account.
Click the appropriate Cloudflare account for the domain where you want to add URL forwarding.
Click the Page Rules app.
Under Page Rules, click Create Page Rule. The Create Page Rule for dialog opens.
Under If the URL matches, enter the URL or URL pattern that should match the rule. Learn more about wildcard matching.
Next, click Add a Setting.
Choose Forwarding URL from the drop down menu.
Click Select Status Code and choose 301 (Permanent Redirect) or 302 (Temporary Redirect).
Enter the destination URL.
To finish, click Save and Deploy.
Hope I could help, if not, the page contains some other interesting solutions under the Advanced Forwarding Options, such as using variables.

Page Rules are great and will help to route the traffic as you want. There is a good tutorial with examples here, https://community.cloudflare.com/t/using-page-rules-to-perform-redirects/55386. In particular, the section about using variables will be particularly useful for what you want to accomplish.
If you have questions are you work through the rules, let us know at the Cloudflare Community, Community Tip - Welcome stackoverflow Visitors, https://community.cloudflare.com/t/community-tip-welcome-stackoverflow-visitors/99529
+1 to "Page Rules works with both HTTP and HTTPS" from Faiz! That is correct. This statement is not accurate -> "unfortunately page rules only works with http".

Related

How do I redirect OldSite.com to NewSite.com/Sub/NewPage

I need to redirect several URLs to a new site that will have pages that replace the old sites. I don't care if the URL is masked or not. I just need the URL's to go to the new pages on the new combined site.
For example:
Oldsite.com redirects to NewSite.com/Sub/NewPage
Oldsite2.com redirects to NewSite.com/Sub/NewPage2
Oldsite3.com redirects to NewSite.com/Sub/NewPage3
and so on.
I've tried domain forwarding on the DNS level, but that isn't working (likely because of the subdirectories).
Problem is the New site was developed in Webflow and I don't have access to implement custom code for redirects.
My thought is to host a separate site to act as a hub that handles all the custom redirects to the New webflow site.
Any help or insight would be greatly appreciated.
Your scenario here isn't entirely clear on the types of redirections you're attempting to do.
If you're trying to redirect all paths from the old site to a specific destination page, like this...
oldsite.com/* ➜ newsite.com/sub/newpage
...many modern DNS providers support that.
If yours does not, you can switch your nameservers to Cloudflare DNS free edition, and you'll have the ability to define up to 3 page rules that support wildcard redirections like this.

Are https://sub.example.com and https://example.com considered Cross-Domain?

I'm tracking google ads, my user will first go to
User goes to: https://example.com
And then click a link
User will go through multiple redirects
Finally redirect to https://sub.example.com
My question is, are https://sub.example.com and https://example.com considered Cross-Domain?
If they are Cross-Domain, should I enable google ads Cross-Domain tracking?
They are considered different domains, but you do NOT need to use cross domain tracking. You just need to add one to the referral exclusion list. Here's a great article on how to do just that: https://www.analyticsmania.com/post/subdomain-tracking-with-google-analytics-and-google-tag-manager/

How redirect from subdomain to other domains URI?

Is there any DNS or .htaccess (or combination of a two) solution for this type of redirection:
blog.mydomain.com point to medium.com/my-publication
And yes I am trying to apply this specifically to medium.com publication so if SSL certification or any other environmental conditions are relevant you check how it handles it. I have full control of my domain on the other side.
I am looking preferably into DNS solution because I will not be able to test .htaccess for a while.
Well, as far as I know the only relevant DNS record would be a CNAME record, and it would only allow redirecting the entire subdomain to medium.com.
NAME TYPE VALUE
-------------------------------------------
blog.mydomain.com. CNAME medium.com.
To redirect to a specific URL, .htaccess would be needed, or a webserver that returns a redirect. If it were me, I'd setup a redirect for that specific article:
blog.mydomain.com/my-publication => medium.com/my-publication
But this requires a webserver being setup at blog.mydomain.com.

Redirect my domain

I need to redirect my domain from MyHosting to Godaddy. Currently my client website is maintain in MyHosting , now they need to change their website to Godaddy. Could you please help me to redirect the domain.
Sorry my English is bad.
Thanks in advance
Please use this Link to redirect from one domain to another ......
enter link description here
To Forward or Mask Your Domain Name
Log in to your Account Manager.
Next to Domains, click Manage.
Select the domain names you want to forward.
You cannot forward or mask .tk, .dk or .ch domain names.
Click Forward, and then select Forwarding Domains.
Click Add Forwarding.
Select http:// or https:// as your Forward to option. For more information, see HTTP vs. HTTPS.
Enter the URL you want to forward your domain name to.
Select your Redirect type
301 (Permanent) — Redirects to the site you specified in the Forward To field using a "301 Moved Permanently" HTTP response. The HTTP 301 response code tells user-agents (including search engines) that the location has permanently moved.
302 (Temporary) — Redirects to the site you specified in the Forward To field using a "302 Found" HTTP response. The HTTP 302 response code tells user-agents (including search engines) that the location has temporarily moved.
Select your Forward settings
Forward only — Forwards the domain without masking.
Forward with Masking — Prevents the forwarded domain name URL from displaying in the browser's address bar, and lets you enter Meta Tags for search engine crawlers in the following fields:
Title — Displays at the top of the browser window and in search results.
Description — A short description of your website to display in search engine results.
Keyword — A list of comma-separated keywords that describes the content and purpose of your website.
Masking is incompatible with some sites that use https://, i.e. SSL certificates.
To automatically update your nameservers to accommodate your forwarding changes, check Update my DNS setting to support this change.
Click Add, and then click Save.
To Forward Your Domain Name Without Masking
Log in to your Account Manager.
Next to Domains, click Manage.
Select the domain names you want to forward.
Next to Forwarding, click Manage.
Click Update Forwarding.
Select Forward Only from the Forward Settings menu.
Click Edit.
NOTE: Forwarded domain names can take up to 24-48 hours to activate.
To Remove Masking From Your Domain Name
Log in to your Account Manager.
Next to Domains, click Manage.
Select the domain names to modify.
Click Forward, and then select Forwarding Domains.
Click Update Forwarding.
From the Forward settings pull down menu select the option for Forward Only.
Click Edit.
Click Save.

How to redirect example.mydomain.com to folder.mydomain.com via DNS/.htaccess?

Is it somehow possible to redirect example.mydomain.com, a subdomain which does not actually exist, to folder.mydomain.com using either .htaccess or DNS? How can this be achieved?
When I access DNS from the control panel and click on the Web DNS tab, I see Personal web DNS settings, under which I believe I can submit domains and their values. However, I am confused with the type (web alias, web forward, A, CNAME, TXT, SRV, AAAA...). Could someone help me?
If the .htaccess way is simpler, I would then prefer it.
Thank you.
You wouldn't be able to use .htaccess as the subdomain does not exist.
I assume, from the process you described, that you are using One.com hosting. If so, the following guide will be of help:
Manage your DNS settings
Essentially, a web forward DNS entry will work for you:
Click on the Web DNS tab.
In the hostname/domain column, enter the subdomain you would like to redirect.
Set the type to web forward
Set the value to where you would like to be redirected when visiting the subdomain.
Click the (+) sign to save your changes.
It will take up to 90 minutes for your changes to take effect.

Resources