Adding another domain to the same site?

by 8 replies
9
Let's say i have a website with a domain example.com , site is a big site with a lot of content, etc..

I have another the same domain, just with ending .net (example.net).

Now my question would be, how i can "attach" this .net domain, so that my website with .com domain could be accessible with .net domain as well?

Is that even possible? I mean basically would be the same site, just with different ending (all content, pages, etc.. would be in that .net domain as well as it is now with .com domain)

So let's say i have some page already with .com domain (example.com/page1/), so i want the same page accessible with .net domain as well, so it would be example.net/page1/

I hope you understand what i have in mind.

Any ideas on this?
#programming #adding #domain #site
  • you have to use .htaccess rules to rewrite urls.

    Redirection and url rewriting will do for you

    there are many websites that can help you to make url rewrites online.
  • you can have example.net as an parked domain on the same hosting as example.com or as mentioned already the .htaccess methods.
  • But i'm asking about running the same site on both .com and .net domains. If i use redirect function, does both domains will work for one site?
    • [2] replies
    • Well it depends on the script if it uses $_SERVER['SERVER_NAME'] to find the domain name then It will work. If you have to set the domain name in the admin panel or the config file somewhere then the links form the .net domain will point to the .com domain I would guess.
      • [1] reply
    • You can do it, but do you have any particularly good reason for doing so? Having the exact same content in two addresses isn't good for SEO.
  • Best option is 301 redirect the .net domain to .com domain. You can also open the .com domain in an iframe on the .net domain, and put a robots.txt to forbid search engines from index the .net domain, but i don't think is an elegant solution. 301 redirect is fast, easy and SEO friendly
  • Wherever you registered your domain you should be able to change the domain's records. Set up the A record to point to the same host as your other domain. Or, if you want to simply redirect them, set up a URL redirect.

Next Topics on Trending Feed