I have a domain which I am forwarding. I have updated the DNS successfully and the redirect seems to work, however if the url is accessed via a google search it still goes to the old site and ignores redirect
Can anyone help me understand what might be going on here?
CodePudding user response:
First of all google search database takes some time... even days to update. So if you have changed domain name recently wait for some time/days until google crawls your site again.
For now you may use redirect... for that you should keep your server reachable with old domain. Also adjust/change old server config so that it should accept request and then redirect to the new site.
If google feels end user is being redirected to another site... google.com may think something is fishy and it will stop redirecting.
So in your old site
- load the page as expected.
- then prompt the end user...
Site has been changed/updated, your request is being redirected to the new site. Sorry for inconvenience
- After redirect... user will be happy to see site.
CodePudding user response:
Are you sure that your DNS request isn't cached? You should flush your DNS cache: https://superuser.com/a/547218/129262
After that use a terminal on your PC an ping your domain. Is the returned IP the new or old one?
And finally do a search in Google through an inkognito tab of your browser as your browser caches redirects as well (or delete the browser cache).