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.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Routing a subdomain to anotehr folder while retaining the original address.
Old 05-15-2009, 11:50 AM Routing a subdomain to anotehr folder while retaining the original address.
Junior Talker

Posts: 3
Name: Andy
Trades: 0
I'm using roundcube webmail on my VPS which is located in a nice http://ikershaw.co.uk/roundcube

But I want my subdomain http://mail.ikershaw.co.uk to redirect to the roundcube folder while retaining the original address of "http://mail.ikershaw.co.uk".

I know it has something to do with the .htaccess file but I have no idea what to put in it.

Thanks in advance!
DrCuddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-15-2009, 03:30 PM Re: Routing a subdomain to anotehr folder while retaining the original address.
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
Hello,

One way to do this would be to setup a new virtual container for 'mail.ikershaw.co.uk' and make the document root the roundcube folder.
bmp99 is offline
Reply With Quote
View Public Profile
 
Old 05-16-2009, 12:45 PM Re: Routing a subdomain to anotehr folder while retaining the original address.
Junior Talker

Posts: 3
Name: Andy
Trades: 0
Well I'm using DirectAdmin and when I set mail.ikershaw.co.uk as a subdomain it created a folder for it.

Now I cannot as of yet actually find my roundcube folder anywhere on my server, I'm guessing it's hidden or something otherwise I would have just copied it's contents to the new 'mail' folder, this is why I need the page routed but the name to retain the same.
DrCuddles is offline
Reply With Quote
View Public Profile
 
Old 05-16-2009, 03:58 PM Re: Routing a subdomain to anotehr folder while retaining the original address.
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
the way you would do this with mod_rewrite is to add a .htaccess file in the root with this in it:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^roundcube/$ http://mail.ikershaw.co.uk
bmp99 is offline
Reply With Quote
View Public Profile
 
Old 05-16-2009, 05:35 PM Re: Routing a subdomain to anotehr folder while retaining the original address.
Junior Talker

Posts: 3
Name: Andy
Trades: 0
So, would I place the .htaccess file this was in, in the 'mail' folder?

The 'mail' folder being the folder for the subdomain.

Last edited by DrCuddles; 05-16-2009 at 05:43 PM..
DrCuddles is offline
Reply With Quote
View Public Profile
 
Old 05-19-2009, 07:20 AM Re: Routing a subdomain to anotehr folder while retaining the original address.
L a r r y's Avatar
Super Talker

Posts: 100
Name: Larry K
Location: Arizona
Trades: 0
Looked at my own site, where I have a subdomain called part97, and a folder on my site called part97, which contains the .htaccess file.

I created the part97 subdomain that points to a copy of the Part 97 regulations maintained on another site with a long url. By going to "part97.example.com" I am redirected to www.example.org/long/complicated/url/part97, which is the address that appears in the address bar upon arrival.

I think it applies to what you want to do.

The RewriteCond contains the name of your subdomain and the RewriteRule contains the full address to the destination.

I replaced my host name and destination with yours, leaving the rest intact:

Code:
RewriteEngine on

Options All -Indexes
RewriteCond %{HTTP_HOST} ^mail.ikershaw.co.uk$
RewriteRule ^(.*)$ http://ikershaw.co.uk/roundcube [R=301,L]
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Reply     « Reply to Routing a subdomain to anotehr folder while retaining the original address.
 

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