0

I have static content that is regularly updated that I'd like to maintain 100% up-time for when switching over to new content.

Ideally I'd like to provide a single url such as:

static.mydomain.com/tiles/

that actually redirects to something like

static.mydomain.com/tiles-2016-03-01/

then when I roll-out a fresh update I can quickly update the DNS record to redirect to the new files

static.mydomain.com/tiles-2016-04-28/

Is this possible with DNS alone? Perhaps there's an alternative non-DNS solution I can use?

BTW I have numerous tile sets so would prefer to host them all under static.mydomain.com.

At present I deploy my new content to

static.mydomain.com/tiles-NEW

I then rename the existing "tiles" to "tiles-OLD", followed by renaming "tiles-NEW" to "tiles". Unfortunately this process takes a while due to the huge number of files held under each directory, so renaming via FTP or the web based control panel (my only options) results in a fair amount of downtime. As the site is popular at least some users are always going to experience issues during my renaming process.

Also using a quick DNS change would allow me to quickly roll back to an older version of my files if a problem was discovered with the update.

I'm using CloudFlare for my DNS if this has any relevance to potential solutions.

Alternative Solution

As this is outside the abilities of DNS I solved it using a simple web.config file on IIS (a .htaccess can be used instead on Apache):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="tiles">
          <match url="^tiles/(.*)" />
          <action type="Redirect" url="tiles-20160428/{R:1}" redirectType="Found" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
  • DNS does not redirect. It only ties a domain name to an IP address. There are some other DNS records for aliases, mail exchanges, etc. That is it. – closetnoc Apr 27 '16 at 21:07
  • I found someone mentioning the use of a TXT record, but provided very little detail and my understanding leaves a bit to be desired at present - stackoverflow.com/a/28294347/250254 – Gavin Apr 27 '16 at 21:10
  • As DNS is perhaps looking like the wrong place to look for a solution. I'll experiment and see if redirects are available to me through web.config settings on the Windows hosting plan. – Gavin Apr 27 '16 at 21:14
  • DNS cannot do what you are asking it to do. It is not designed to. – closetnoc Apr 27 '16 at 21:15
  • As for Apache, you can use a redirect within .htaccess. – closetnoc Apr 27 '16 at 21:23
0

No.

A DNS (domain name server) record can only associate Internet numbers and domain names in different ways, such as an A (IPv4) record, AAAA (IPv6) record, and MX (mail server, where to send email to). You cannot give instructions through DNS, such as a 301 or 302 Redirect response, which is what I believe you're asking for. You are going to need to use a web server and/or a content language like Go/PHP to accomplish what you have set out to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.