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.
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.
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]
« Reply to Routing a subdomain to anotehr folder while retaining the original address.