Forum Moderators: phranque

Message Too Old, No Replies

.htaccess for alias between 2 domains

         

seanmichael

9:06 pm on Oct 20, 2010 (gmt 0)

10+ Year Member



Hi everybody,

I always come across this site when I do deep google searches and today I decided to join to ask my question.

I am trying to make it so that when people visit my domain sweetsite.com the resulting website is from my actual site www.tastysite.com. I still want the domain to be sweetsite.com, but have the info come from my normal site tastysite.com

I hope I am explaining this properly. I was hoping I could use an .htaccess file for this as I am on a shared host and can not modify httpd.conf.

I am almost totally new to .htaccess, so any help will be appreciated.

Thanks

g1smd

10:19 pm on Oct 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use DNS to point both sites at the same server, ensure both sites are listed in the server config, and are served from the same folder, and the content in that folder will appear when either domain is requested.

Next, watch your rankings and traffic tank because you're serving Duplicate Content. Add a canonical redirect to the server configuration so that if the "wrong" domain is requested, user is redirected to the single canonical domain that you choose to be the one to serve the content.

jdMorgan

12:58 am on Oct 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you are effectively paying for another "site" to copy the entire contents of your own site, and then use it to compete with you -- halving the chances for any given page on either one to get a top search ranking.

So, the technology part is easy (point the DNS), but the goal is just wrong...

Unless you have some very specific reason to do this and are willing to accept the consequences of competing with yourself, I suggest that you re-assess the advisability of doing it.

Jim

seanmichael

3:29 pm on Oct 21, 2010 (gmt 0)

10+ Year Member



Yes...I a shopping cart that will will run two stores based on the domain name. So when a user types in store_a they are served items and a template to sell those items that only store_a has. When a user visits store_b they are served up item that are only respective to store_b so I am really not concerned with the seo implications, I am worried about how to do what I asked in the original question. I thank you both for you replies, I am going to try changing the DNS right now for store_b, but I think that will change the address bar to store_a...which is what I do NOT want. I'll have to give it a try

jdMorgan

10:04 pm on Oct 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The address bar will change if you do a client redirect -- typically a 301 or 302 in most applications.

But DNS has nothing to do with redirects, or even with HTTP itself. DNS requests are sent by the browser to the DNS system to determine what IP address to send the HTTP requests to, given the requested hostname. Keep in mind that Web servers (the physical boxes) are accessed by IP address and not by "domain name." This operation is sufficiently transparent that most people don't even know it happens. Hopefully, that will clarify things a bit for you.

Jim