Root level redirect | Community
Skip to main content
Robb_Barrett
Level 10
January 9, 2020
Question

Root level redirect

  • January 9, 2020
  • 3 replies
  • 6076 views

We're changing our CNAME.  This is a mess because we have a lot of links - email, web pages, linkedin, etc pointing to info.oldcname.com/various-page-names.html and we want to redirect them to info.newcname.com/various-page-names.html.

Is it possible to do a root level redirect and preserve the page names without the need to go through the arduous task of re-directing each individual page?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Casey_Grimes2
Level 10
January 9, 2020

In a case like this, your best bet is probably to handle such a redirect at the DNS level. Now, while it's strongly discouraged because you're doing two lookups, it's totally possible to do something like

info-old IN CNAME your-instance.mktoweb.com.
info IN CNAME info-old

So when you look up info, it goes to info-old, then to your-instance.mktoweb.com. However, what you're describing sounds more like swapping the root domain rather than the CNAME. Same concept applies, though.

Depending on your DNS provider, you may be able to set up redirects rather than chaining CNAMEs, but it's a non-standard thing and depends on who you have.

SanfordWhiteman
Level 10
January 9, 2020

This won't change the URL in the browser (nor the cookie domain). It isn't any different from swapping the Primary LP Domain with a Domain Alias.

Jay_Jiang
Level 10
January 9, 2020

in apache servers using htaccess you can:

create your new cname and update settings in marketo as such

delete your old cname and create a subdomain of the same name

add a htaccess file to the subdomain root with 301 redirect to rewrite domain to new one

SanfordWhiteman
Level 10
January 9, 2020

This is a Marketo LP domain, however.

Jay_Jiang
Level 10
January 9, 2020

delete the old cname and create a subdomain of the same name, place the htaccess file in there.

so any hits to oldcname.domain.com/pageXYZ gets rewritten as newcname.domain.com/pageXYZ

https://moz.com/learn/seo/redirection on why you should use 301 redirects instead of js or meta refresh

SanfordWhiteman
Level 10
January 9, 2020

If you don't need an HTTP redirect, you can trivially perform this redirect using JS on your template.

In fact using JS is the only way to preserve the Munchkin session association, so you don't end up with anonymous visits for people you previously knew.