Can I use Cloudflare to 301 redirect domains without A records? - redirect

I am using CloudFlare to manage my websites DNS. I want to use Page Rules to setup redirects for a number of URLs to go to another website URL.
Currently my hosting account, I have set them all up as addon domains and then setup redirects in CPanel.
I am moving across my sites to my own cloud server without a CPanel - I am using VestaCP. I don't want to clutter up the website records by adding each and every site I want to redirect to the host (there is a dozen of them) - I want Cloudflare to manage it all.
Is it possible to do this? Like use Cloudflare page rules and remove the A record pointing to the host server IP?

In order for you to use Page Rule to redirect to another site, there are 2 conditions:
Valid A record or CNAME record
That record is orange-clouded
The A record can point to any public IP address, for example 8.8.8.8, it doesn't matter because the visitor will be redirected away anyway. However it can't be IP address that belongs to Cloudflare (e.g. 1.1.1.1).
Similarly to CNAME record, can be pointed to any domain/subdomain (e.g google.com).
Cloudflare has a KB article that explains how you can configure the Page Rule to do the 301 redirection.

Related

Redirect Multiple Domains to Single Domain Using Single Domain's 'A' Records

I have multiple domains; example.com, myexample.com, exampleweb.com, etc. My DNS for example.com has over 20 subdomains (e.g. www.example.com, client1.example.com, client2.example.com, etc). These various sub-domains' 'A' records actually point to different IP addresses where different web servers are running, so www.example.com may go to one IP address while client1.example.com points to another IP address and client2.example.com points to a third IP address.
I was hoping I could build all the 'A' records in example.com (they are now) so that any time a browser calls for www.myexample.com it is redirected to www.example.com where the 'A' record points to the proper ftp server's IP address. Also, if the browser calls for client1.myexample.com it is redirected to client1.example.com where the 'A' record points to another web server.
It appears that I cannot do this in DNS. It also appears the only solution is to manually create redundant 'A' records in all of our synonym domains then create redirect records (in web.config) on each web server where we redirect the synonym domains to example.com.
We have a wildcard SSL certificate for example.com and don't want to purchase and maintain extra wildcard SSL certificates for all of our synonym domains.
Am I understanding this correctly? We work with IIS web servers.
I tried altering the CNAME record. I tried a single redirect via the web.config (partially works but have to do this for all web servers). Modified DNS for one of the synonym domains to point to the web server with the redirect action. These are only partial solutions. It looks like I have to combine all actions, which is a very complicated solution.

How to make Azure Traffic Manager work when 301 redirecting custom domains?

I have a couple of web apps in azure (same codebase, in different regions) that I need to set up as end points in Traffic Manager.
One of those sites is already Live. It is configured to support multiple domains, but all requests are 301 redirected to a specific domain, for SEO reasons. The other site needs to work in the same way of course, within the Traffic Manager setup.
The issue is that Traffic Manager needs to be able to ping the *.azurewebsites.net domain and receive a 200 response to work, but with the current redirect rule in place on the endpoints, this will not work.
If I remove the redirect rule then Traffic Manager will work, but it means that requests for the sites at *.azurewebsites.net will not be redirected (and so presents an SEO concern).
The solution I'm heading towards is serving up a different robots.txt file (with a Disallow: / rule) if the request is for the azurewebsites.net domain. Is this feasible? How might I go about doing this?
Are there any other ways I could make this work?
thanks
I'm going to rework the current redirect rule so that it doesn't redirect for one particular path on the azurewebsites.net domain (*.azurewebsites.net/favicon.ico), which should enable Traffic Manager to ping the site, whilst keeping SEO ok for the rest of the Urls.
7 years later and some months, the answer seems to be in the traffic manager's config under other expected codes, so you can add 301-302 to that list to make your host health show online.

How should I configure my DNS records to direct all traffic from one domain to another?

I have a doman, mydomain.com as well as mydomain.biz and would like the the latter to be a synonym for the former: whenever a user enters www.mydomain.biz they are taken to www.mydomain.com.
I have everything working for mydomain.com and thought, from my limited understanding that a CNAME record would accomplish what I'm trying to do, so I have
NS mydomain.biz. = (nameservers that work fine)
SOA mydomain.biz. = (values that work fine)
CNAME *.mydomain.biz. = mydomain.com.
and when I host mydomain.biz I get
www.mydomain.biz is an alias for mydomain.com.
followed by other information that exactly matches what I get with host mydomain.com. Yet, any attempt to navigate to www.mydomain.biz fails.
I'm also perplexed by what I see when I look at propagation of my NS records. Checking for mydomain.biz gives the nameservers specified above, but checking for for www.mydomain.biz gives the values specified (elsewhere) for mydomain.com
Am I not going about this the right way? How should I configure my DNS records to direct all traffic from one domain to another.
DNS cannot redirect a request. Lets take an example on what CNAME does to clarify:
CNAME: domainA ==> domainB
What that would do is send requests for domainA to the same IP as domainB. However the URL will remain domainA (so it's not a redirect, a redirect would actually change the URL).
If you are okay with having the site load under two different domains, then a CNAME record will do the job. However you need to make sure that your server is configured to handle requests from both domainA and domainB. The way you do that is very different depending on your server environment. For example if you are using apache, your virtualhosts determine what domains are handled (you could set it up so any domain is accepted). If you are on shared hosting however, you will likely be restricted to the domain you signed up with. Adding more depends on your web host so you'd have to take it up with them.
If on the other hand you want the visitor to be redirected to domainB, you'd have to point domainA to a server that would return an HTTP redirect. It could be the same server, you just need to configure it to return the HTTP redirect if the request is for domainA.

Domain Redirect

I have domain for ex. example.com. That domain blocked in malaysia. So i am planning to redirect example.com to example.my only for malaysian user. I know how to redirect domain using php, javascript etc, those are server and client level, but i dont know how to do it in domain level. My domain is registered on name.com, but it seems they dont have feature to redirect domain by country. is there any other way to do this?
You would need to use GeoIP to see if the incoming request is originating from Malaysia and then redirect accordingly.
You need to recommend all visitors to use public DNS instead of local ISP DNS which has blacklisted your site example.com.
You can block the country wise access by blocking the IP range of that company fro the control panel or from the server.

How can I redirect a page url (example.com/pageurl) from my domain registrar?

So I have a Tumblr, which means I can't use htaccess, and am hoping there's a way I can redirect page url (example.com/post/2234324/posttitle to example.com/page), purely from my registrar (Namecheap).
Is there host records I can change, or something else, to redirect urls on my domain?
If you have access to your DNS and can add A records, etc. then look at CNAME record. Here you can enter an alias domain. This is commonly used with Amazon S3 when you set cdn.myco.com and your amazon bucket is cdn.myco.com.amazons3.com or if you use Google Apps for Business to manage your email.
SEE: http://support.google.com/blogger/bin/answer.py?hl=en&answer=58317
good instructions for various hosts