0

The server where I developed a wordpress site was indexed by google. The site is now live with the actual domain, but google searches find links to the site at development server adddress. The site is on the same server where developed, making it live was simply pointing the domain to this new site. I need to redirect these links, but am not having an luck.

Also, the developer server address has a tilda, which was indexed as %7E in google. I have tried various version of the following, all to no avail.

RewriteCond %{HTTP_HOST} ^cardgym\.dcaccess\.net
RewriteRule ^cardgym.dcaccess.net/~chrs/$ http://chrs.org/$1 [R=301,nc]
RewriteRule ^/%7Echrs/(.*)$ http://chrs.org/$1 [R=301,nc]

going to development server results in an 404 error in wordpress: http://cardgym.dcaccess.net/~chrs/

Thanks

2 Answers2

0

Can you change your internal web server configuration so that the development domain is an alias of the live site? That would be the easiest solution imo.

Otherwise check out the answer by Sigg3.net here RewriteRule for tilde

Community
  • 1
  • 1
Joe T
  • 2,300
  • 1
  • 19
  • 31
0

If I understand you correctly your site is live and you moved it to the new domain. So it appears you already have the live site up and going at http://chrs.org. So there is nothing you need to do to redirect it as far as Google indexing.

It will take Google time to crawl the new site and index it.

You can help speed up the process by asking Google to index your new site by submitting it here.

https://www.google.com/webmasters/tools/submit-url?pli=1

.htaccess does not control the way Google indexes the site. If its on the internet it will be indexed unless you prevent it. There are a few options you can do to help make those dev links disappear.

A. Add a robots.txt to the root of the dev site with this code below in it and that will keep Google/search engines that respect robots.txt from indexing it.

# Make changes for all web spiders
User-agent: *
Disallow: / 

B. Block the site using htaccess protected directory for the whole site which will stop it from being crawled.

OR

C. Take the dev site down.

It appears you've already moved the dev site to live domain that's why you are getting 404. The links in Google will disappear eventually because they no longer exist. The next time Google tries to crawl your dev site and see's it's not there the links will be removed. The new site will start to show up as Google begins crawling it. There is nothing you can do right now but wait. It can literally take weeks.

If indeed you really are trying to redirect, then you can add an htaccess file on the cardgym.dcaccess.net site using redirect.

Redirect 301 /~chrs http://chrs.org
Panama Jack
  • 24,158
  • 10
  • 63
  • 95