Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macsig

macrumors regular
Original poster
Oct 27, 2006
236
0
Marina del Rey, CA
Hello guys,
which is the best way to point a domain to a page of an other domain?

Basically when someone goes to secondDomain.com must be redirect to domain.com/page2.

Can I achieve so all "server side" (without create a second site with a redirect page)?


Thanks and have a nice weekend
 
If it is a Apache web server then you can use a .htaccess file to do the redirect.

mod_alias

Code:
Redirect 301 / http://www.example.com/
If only the domain name has changed, and the site folder structure and pages are in the same place then use,
Code:
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
 
Yea, just use the first example I gave and provide the file name to the end.
Code:
Redirect 301 / http://www.example.com/page2
For your 2nd question:
Code:
Redirect 301 /whatever http://www.secondDomain.com/
 
thanks.
Sorry I didn't understand what you mean the first time.

In my second question when I put "whatever" I mean really any pages beside secondDomain.com you try to reach so can I use a regex in your second code?

Thanks again


Sig
 
In my second question when I put "whatever" I mean really any pages beside secondDomain.com you try to reach so can I use a regex in your second code?

So there's only one page, the home page? Why would they be trying to access anything else if there's only one page? If so, then you would use,
Code:
Redirect 301 /.+ http://www.secondDomain.com/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.