Reply
Quick question
Old 08-20-2007, 07:54 PM Quick question
Skilled Talker

Posts: 53
Sorry for the rubbish title, I didn't know quite how else to put it.

I have a client that would like two website domains. The first domain, for example mybook.com would be a site that had information about her book and where you could buy it.

The second domain would be an empty site, and all it would do is when you typed the url, for example mywork.com, you would immediately be directed to mybook.com without having to click on a link or anything like that.

Is this possible? And if so, what code would I use so that when you typed in mywork.com you would automatically be directed to mybook.com
lilycup is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-20-2007, 07:57 PM Re: Quick question
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 386
Name: Jamie Lewis
Location: UK
Yes It is possible.

You could use .htaccess (ala http://www.javascriptkit.com/howto/htaccess7.shtml) to redirect or just a simple php file.

Jamie
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-20-2007, 08:07 PM Re: Quick question
Skilled Talker

Posts: 53
Thank you! I will have a look at that now.

Would this work also?:

Code:
 <Body onload="location='http://www.mybook.com';">
lilycup is offline
Reply With Quote
View Public Profile
 
Old 08-20-2007, 08:20 PM Re: Quick question
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 386
Name: Jamie Lewis
Location: UK
It would, but it wouldn't work for people with javascript diabled, search engine spiders or text browsers.

Jamie
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-20-2007, 08:30 PM Re: Quick question
Skilled Talker

Posts: 53
There's always a catch.

So if I were to use the .htaccess would I just have a normal index page and somewhere in the code put this:

Code:
Redirect /olddirectory/oldfile.html http://www.mybook.com
How would I change the oldfile.html section to be mybook.com?
lilycup is offline
Reply With Quote
View Public Profile
 
Old 08-20-2007, 08:36 PM Re: Quick question
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 386
Name: Jamie Lewis
Location: UK
You would put that in a file called ".htaccess", there is no file name just the ".htaccess" extension.

Jamie
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-20-2007, 08:43 PM Re: Quick question
Skilled Talker

Posts: 53
Ok, thank you.
lilycup is offline
Reply With Quote
View Public Profile
 
Old 08-20-2007, 08:50 PM Re: Quick question
Skilled Talker

Posts: 53
I got it to work perfectly, thank you very much for your help!
lilycup is offline
Reply With Quote
View Public Profile
 
Old 08-20-2007, 10:51 PM Re: Quick question
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
Check to make sure it's a 301 ( permanent, not temporary ) redirect being used. I you don't promote the other domain it won't really matter, but if a link gets out to it, the main site may as well benefit.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to Quick question
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15663 seconds with 12 queries