Creating a subdomain that redirects to a URL?

I had this working when I used Namecheap's DNS, but I can't seem to get it to work for Linode's. To the point, I want linkedin.mydomainname.com redirect directly to my LinkedIn profile, which is a URL.

I thought you did this with the CNAME?

5 Replies

Correct, you should be able to do this with a CNAME. What is the error you're getting when you're trying to do it on Linode?

@mkorsak

The error I'm getting is: • You have entered an invalid target. It must be a valid hostname.

In the fields for the CNAME page I have

Hostname: linkedin

Alias: http://www.linkedin.com/pub/ (where the ** are the remainder of the URL)

TTL: Default

edit: I've also tried linkedin.url.com in the Hostname field as well. I guess I just don't understand how to make that a valid hostname?

I have to disagree with mkorsak here. The value of a CNAME record has to be a hostname (eg. www.linkedin.com), not a URL (as you've shown). For what you want you'd have to have DNS point to your server and use URL rewriting functions in your web server.

tonyyarusso is correct.

Point the subdomain to your Linode. Have your webserver have a rewrite rule for linkedin.mydomainname.com (301 redirect) that points to your LinkedIn URL instead.

A CNAME is an alias not a redirect.

Ah that's right, my mistake. It's been a while since I've set one up, and now that I think about it, I've always used it with just normal hostnames. Redirect rules or a page that redirects on your server will do just fine.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct