Forum Moderators: open
Google is now showing the site as listed as www.example.com and ns.example.com/~adminxx/ (ensim domain preview).
Is there any way I can get the preview domain removed?
I cannot use meta tags (noindex etc) or robots.txt (disallow), as that would impact on the domain as well.
I'd hate to get him hit with a dupe penalty.
[edited by: ciml at 8:22 am (utc) on Jan. 28, 2004]
[edit reason] Examplified domains. [/edit]
if you are finished with the preview then delete it, google will get 404's and drop the pages
I think the way ensim does it, is that the domain is like a pointer. Adding a robots.txt to the preview site will also show up on the domain site.
Maybe cloaking is the way to go. I know how to get the current page etc. but finding out whether the visitor is on the preview domain or the actual domain may take some work.
Thanks guys.
RewriteEngine On
RewriteCond %{HTTP_HOST}!^www\.domain\.com
RewriteRule ^.*$ [domain.com%{REQUEST_URI}...] [R=301,L]
If on linux, using Apache with Mod_Rewrite installed (which is almost always the case), this code will redirect the ns.domain.com/~preview to www.domain.com
Let me know if it works for you (I use it on all my sites, gotta love 301 in mod_rewrite).
A PHP script was suggested as an alternative for FrontPage users by a member with an all-php website at:
[webmasterworld.com...]
as follows:
if ($_SERVER['HTTP_HOST']!= "www.yourdomain.com") { if ($_SERVER['SCRIPT_NAME']!= "/index.php") $url = "http://www.yourdomain.com" . $_SERVER['SCRIPT_NAME']; else $url = "http://www.yourdomain.com/"; header("HTTP/1.1 301 Moved Permanently"); header("Location: $url"); }
I have an htm website and never have used php. I tried variants in my header, inserting the php code between
<?php and ?>, but could not get it to work. Any suggestions? Also, would switching to Windows hosting solve the problem for FrontPage users?