How to redirect a deleted subdomain? - .htaccess

I want to (301) redirect all incoming traffic/links from blog.example.com to wwww.example.com. The blog.example.com subdomain does not exist anymore. How can I do this with the .htacess file on www.example.com?

This is a question better asked on ServerFault.
Anyway: This can't be done without having the domain. Domains are managed by the domain name system (DNS). Redirects are part of HTTP which is something completely different. If there's no longer a domain blog.example.com, the web browser can not resolve the address for it and thus has no way to connect to a HTTP server that could redirect it to www.example.com.
You need a valid DNS entry for blog.example.com otherwise this will not work. In your case you'd use a CNAME entry, i.e. tell the resolving system that www.example.com is the canonical name for blog.example.com. The client will then resolve www.example.com, but connect to the HTTP server with the host header being set to blog.example.com. This allows the HTTP server to answer with a redirect to www.example.com, which the client then can follow.

Related

How to change DNS settings to redirect website.com to www.website.com?

I have a DNS linked to Sites using CNAME from www in my DNS settings below. So when i type www.website.com it redirects me properly but when I type website.com nothing happens. I am thinking about editing # to add something to redirect to the www but I am not sure how to do that. Cold you please help me out?
Depends on the web server your utilizing, but what your looking for is url redirects. You can put in different urls and have the redirect to the primary. So you would place your domain.com in here to redirect to your binded url which is the www.domain.com. should also be able to use it to redirect http to https, though this is usually less of an issue with browsers and servers today.

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.

A record / CNAME redirect

How can I set up e.g. when I type www.example.com (so, my domain which I have access) to points to https://stackoverflow.com/questions/ask (I don't have acces, I just want to redirect there) using A record or CNAME in my domain name register?
There are two ways of doing this; DNS and HTTP redirect.
If you use DNS, you can only redirect the www.example.com to stackoverflow.com only (not its sub-directories).
Another approach is to create .htaccess in your www.example.com and redirect the page to https://stackoverflow.com/questions/ask. Please read here
It seems you need to take the second approach because you want to redirect your users to specific sub-directory.

Is my website www or without www subdomain?

This seems like a really stupid question, but I can't tell if my website uses the www subdomain or without.
I purchased an expired domain a month ago and set up Google Webmastertools with a sitemap and all. It's indexed, but when searching for the website name, it's no where to be found. Webmastertools says that 'no data is available.' The support states that the www subdomain may be a factor.
How can I verify this? I've used info: domain.com, site: domain.com, info: www.domain.com and site: www.domain.com It pulls up domain.com
Thanks in advance!
Need to find whether the both www and non-www are pointing to same IP address. For this, Open command prompt (click start button >> run >> provide code "cmd"). Once command prompt is launched, then run the code "Ping domain.com" you can find a IP address and then run "ping www.domain.com" and you get another IP address. If both IPs are different then you have setup A record in DNS.
If they are same IP address, non-www need to redirect www or www redirect to non-www. To find this, provide both URLS on http://www.redirect-checker.org/ find out which are getting 200 status. The 200 status URL are need to be added on webmastertool.
Let me know if you need further help.
Who is handling the DNS? If you own domain.com, the www. is (as you said) a subdomain.
You can register any subdomain you want as long as you are pointing it to somewhere. For example if I set up domain.com with DNS pointing to the hosting I would create an A record for the subdomain www that points to the same IP address.
From there I would check the Host server and (I use IIS) make sure that the bindings for the domain are set up, usually I bind it to www.domain.com as default and then just send domain.com there.
I hope this helps answer your question

Domain DNS settings redirection (www to https)

I have a SSL certificate for domain example.com. I want to redirect www.domain.com (and also the 2nd domain, e.g domain.com.au) request to the domain.com. In the example.com domain DNS setting I see
CNAME www.example.com is an alias of example.com
do I have to play with that entry or maybe set up that redirection on my server (Windows Server 2008 R2) ?
The CNAME only tells the browser (or more accurately, the resolver) how to find the IP address of the domain name. In this case, when the browser tries to resolve "www.example.com", it finds a CNAME record, so it needs to follow that alias and resolve "example.com". Eventually, it should arrive at an IP address to which it can make a HTTP(S) connection.
In short, yes, you need to setup the redirection on your web server as well.
Use URL Rewrite for redirections. It's a bit cryptic at first but it's a powerfull tool in IIS for this purpose. http://www.iis.net/learn/extensions/url-rewrite-module

Resources