2 replies
  • WEB DESIGN
  • |
Have a newly registered site on shared hosting at hostmonster.

Due to the allegedly helpful feature provided by the cpanel of setting all addon domains resolving also as subdomains of the primary, search engines (on their own) discovered:

mynewdomain.primary.com

before finding mynewdomain.com

anybody have an easy way to redirect mynewdomain.primary.com

to mynewdomain.com?

This is for a client site, and I really don't want the client's stuff mixed in with mine and vice-versa
#htaccess
  • Profile picture of the author naffets77
    Try the following your htaccess file

    Code:
    # This allows you to redirect your entire website to any other domain
    Redirect 301 / full url
    You could also do it with PHP

    Code:
    <?
        Header( "HTTP/1.1 301 Moved Permanently" ); 
        Header( "Location: full-url" ); 
    ?>
    Also you can go to your webmaster tools at least with google and tell it to remove that subdomain from its spidering.
    {{ DiscussionBoard.errors[1858282].message }}
    • Profile picture of the author RobinInTexas
      I think I solved it:

      RewriteEngine On
      RewriteCond ^primary\.mynewdomain\.com/$1 [NC]
      RewriteRule ^(.*)$ http://www.mynewdomain.com/$1 [R=301,L]

      seems to work.
      Signature

      Robin



      ...Even if you're on the right track, you'll get run over if you just set there.
      {{ DiscussionBoard.errors[1860186].message }}

Trending Topics