Redirecting domain question

Myler

the horror.
Apr 25, 2009
532
6
0
G16
Help me out bros. This is the situation;

- Registered first-domain.com from a domain registrar
- bought hosting from another provider

Now I want to point my old domain (no hosting there, they offer only dns server change) second-domain.com to first-domain.com

How do I do it? I've looked into htaccess but there are some things there I'm not familiar with...so I'm not sure what to edit.

Code:
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName first-domain.com
AuthUserFile /home/firstdom/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/firstdom/public_html/_vti_pvt/service.grp

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

thanks :D
 


Modify the DNS record of second-domain.com to first-domain.com at your registrar level.

The above .htaccess (on first-domain.com account?) has nothing to do with redirect. If second-domain.com has an own hosting account, then you can use .htaccess to redirect
 
What arxs said ^

Go to second-domain.com and change DNS servers to first-domain.com's DNS servers, then add the domain to first-domain.com (mapped to the first-domain.com web-server-directory/directory containing the site).
 
Place this code into the htaccess file of the second domain:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^second-domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.second-domain\.com$
RewriteRule ^(.*)$ "http\:\/\/www\.first-domain\.com\/$1" [R=301,L]

Should do the trick.