Forum Moderators: phranque

Message Too Old, No Replies

Another domain name, same site-possible?

         

kslnor

5:00 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



I'm trying to wrap my mind around the idea of domain name parking and pointing. What I would like to do is purchase another domain name and when someone enters this domain name they are sent to a specific page within my site. Is this possible? I think I understand the concept of domain parking, which will send a visitor to the main page of the site, but I would rather the visitor be sent to a certain page.

I have read a few articles about 301-redirects...would this apply? I want this to be as clean, proper, and search-engine friendly as possible. Any suggestions? Thank you.

jonrichd

11:51 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



Here's one idea, but it depends on your having some control over your server.

What I've done for this issue is to point both domains to the same server space. This means that requests for domain1.com and domain2.com would both result in the same page appearing in the browser. My host allows me to specify the domains that point to my account. If you have a dedicated server, then you obviously control what goes where.

Once you have both domain names pointing to the same space, you can use an .htaccess file that is going to look something like this:


Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.alternatedomain\.com
RewriteRule ^(.*)$ [maindomain.com...] [R=301,L]

This code says if a request comes in for your alternate domain, do a permanent redirect to yourpage.htm on your main domain.

Note that the first two lines may or may not be required, depending on how Apache is set up.

If you are using an IIS server, you can use the IIS manager to do the same thing by creating a new web site, and then indicating that the content can be found by a permanent redirection to an URL. (If you are using an IIS host without access to IIS manager, you will have to plead with your host to get this done).

kslnor

11:54 pm on Apr 28, 2006 (gmt 0)

10+ Year Member



Thank you for your insight. I tried your suggestion and it partially worked. When I enter the new domain name, I am taken to the main page of the site, not the internal page I desire. I'm not sure what to look for as far as any potential problems. Any further assistance available?

Thank you.

tedster

5:37 am on Apr 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think this does it in Apache -- instead of using yourpage.htm as in the above code, use $1 to match whatever file path is in the original request.

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.alternatedomain\.com [NC]
RewriteRule ^(.*)$ [maindomain.com...] [R=301,L]

Or, on an IIS server, you would do this

Let's suppose that you have a web site [example1.com...]
and you want [example2.com...] to do a 301 redirect to
the [example1.com...] site.

1. Set up the example2.com web site in Internet Services
Manager and enter into the Properties.
2. In the Home Directory tab, change the option button "When
connecting to this resource the content should come from" to
"A redirection to a URL".
3. Specify the URL as [example1.com$S$Q...]
4. Check the checkbox that says "A permanent redirection for
this resource."

Note that in Step #4 variables are needed
$S will preserve the file path, and $Q will preserve any query string