Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 07-19-2006, 05:42 PM domain redirection
Super Talker

Posts: 111
Trades: 0
Hey guys
I run a small free file hosting for people. and in the coruse of couple of years, it has gotten pretty big, so im changing hosts.

However I have a issue.
If I change hosts then the domain will change (subdomain).

I was wondering if its possible to redirect domains.
Ok for example.

Currently, I the upload page is at.
host.test.example.com
and the files hosted there are in
host.test.example.com/files/filename.txt

Now, I want it so that when a user goes to host.test.example.com it redirects them to
host.newexample.com.

and same with files.
So, if someone tries to access, host.test.example.com/files/filename.txt
I want it redirected to
host.newexample.com/files/filename.txt

Is it possible? I'm guessing I can do this with htaccess.
Btw, I have access to both hosts.
__________________

Please login or register to view this content. Registration is FREE
sixpacgenius is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-20-2006, 07:35 AM Re: domain redirection
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
What server are you on.

I.E Apache IIS ???

If its the former you can use htaccess to do this. There are similar tools (I am led to beleive) for IIS so you should be able to get it done in either.

--> htaccess method

#domain to newdomain
RewriteCond %{HTTP_HOST}% ^host.test.example.com$ [NC]
RewriteRule ^(.*)$ http://host.newexample.com/$1 [R=301,L]

Dont quote me on this either but any URL that resolves to the old format will be changed to the new so tracing old domains should nbot be an issue. You will need to place this htaccess in your top level public_html dir.

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf

Last edited by ibbo; 07-20-2006 at 07:42 AM..
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 07-20-2006, 02:42 PM Re: domain redirection
Super Talker

Posts: 111
Trades: 0
Yes, I'm running apache, and I'm going to test this when I get home.
Thanks for the help man.
__________________

Please login or register to view this content. Registration is FREE
sixpacgenius is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to domain redirection
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.18242 seconds with 12 queries