2

We have our IIS sites and DNS settings on AWS, so Route 53 for managing domains. We disabled an old site on our server, and I now need to route any requests for any page on the old site, to the homepage of a new site.

https://www.oldsite.example/* to https://www.newsite.example

The only way we've been able to do this seems to depend on the same URL being on the new site, which is not the case. This is the way it's working now.

https://www.oldsite.example/apage.html to https://www.newsite.example/apage.html

Any way in AWS to make ANY URL request from the old site redirect to JUST the homepage of the new site?

0

3 Answers 3

2

Redirecting to the home page is not a good idea. It is bad for SEO and it is bad for users.

Google calls redirects to the home page "soft 404" errors and treats them just like regular 404 errors. Google does not pass link juice from the old site to the new site when you redirect to the home page.

Redirecting to the home page of the new site is bad for users because they can't find what they were looking for and they don't get a meaningful error message. Bookmarks and inbound links break in a non-obvious way.

Instead of redirecting to the home page, you want to individually redirect each page to the equivalent page on the new site.

  • https://oldsite.example/ -> https://newsite.example/ (home page redirect)
  • https://oldsite.example/content/blue-widgets -> https://newsite.example/blue-widgets.html (Redirect where path changes)

When a page has been removed with no equivalent page it is best to show a 410 Gone status with a custom error message like

oldsite.example/content/blue-widgets was removed. Please visit newsite.example which has our new product line.

In any case, it is always more than just a DNS setting to enable redirects. DNS can only point a domain to a web server. It is always up to the web server if URLs should get redirects, error pages, or content. The web server can base that decision on the requested domain name and path.

You need to use Route 53 to point olddomain.example to your IIS server. Then you need to configure IIS to properly handle each URL from the old domain.

9
  • This answer is useful if there is a mapping between pages from the old site to the new site.
    – TZubiri
    Jan 20 at 2:32
  • If there is no mapping then redirect just the home page and use 410 Gone with a custom message for every other page. Jan 20 at 8:33
  • I appreciate the SEO considerations here, as I am not knowledgable here. In the case that a mapping is available, redirection at the DNS level seems cheaper to maintain to me, and perhaps faster. Would this have any disadvantage from an SEO perspective?
    – TZubiri
    Jan 20 at 22:28
  • There is no such thing as redirecting at the DNS level. You always have to run a web server to do a redirect. Some DNS providers do offer redirect options but they implement it by running a web server in addition to DNS. Jan 20 at 22:34
  • 1
    No, it is very common to use CNAME records for other purposes. For example some web hosts (like Heroku) give you a subdomain like some-site.hosting-company.example and tell you to use a CNAME for your domain that points to that. It doesn't have any sort of semantic meaning other than you have a hosting relationship with that company. Search engines don't do anything differently if you CNAME records vs A records. Jan 21 at 23:36
0

The simplest solution is to create an A record for oldsite.com that points to the same address pointed to the same address as newsite.com

If this doesn't work it's because the HTTP server is checking for domain names in HTTP requests (through the 'host' HTTP header)

In order to solve this problem you need to tell your HTTP server that oldsite.com is a valid name for your server. The server was already configured to know that it's name is newsite.com, so you should look for that configuration file and copy the syntax for oldsite.com

Another slightly more maintainable solution is to use a CNAME record, which allows a domain name to resolve to another domain name. In this case the record would point from oldsite.com to newsite.com Browsers will be free to use either oldsite.com or newsite.com as a "host" HTTP header, so make sure to solve the same issue if there's domain name filtering involved in your server configuration.

0

You could install IIS rewrite module and use the redirect 301 to let the SEO knows this is permanent redirect.

And here is the code , just append in web.config to setup the rewrite in your old site.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="test" stopProcessing="true">
                    <match url=".*" />
                    <action type="Redirect" url="https://www.google.com{PATH_INFO}" />
                </rule>
            </rules>
        </rewrite>
        
    </system.webServer>
</configuration>

0

Your Answer

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