FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


redirecting domain to directory & directadmin - how?





cambridge
all advices I've found was related to cpanel (eg. http://frihost.com/forums/viewtopic.php?t=13111). I'm on directadmin and cannot find method for redirecting already bought domain to subdirectory under public_html. Domain is transfered to frihost NS'es and is visible in DA. What now?

pls help.
holadola
I am not really sure of what you want. Do you want www.yourdomain.com to have its webroot in /public_html/anotherdir instead of public_html/ ?

/hd
Bondings
I also don't understand what you mean. You should add the domain in the advanced settings of DirectAdmin.
cambridge
@holadola:
exactly. I would like to redirect domain or subdomain to directory under public_html

@bondings:
as I see, I can only add domain to directadmin, then a new folder appears a level above. but what if I want to redirect .com domain (or subdomain created in directadmin) to a subfolder?
holadola
I am still not really sure what you want to achive and why, but if you want a doamin to have its root in /public_html/blaha/ instead of /domains/domain.com/public_html/ I guess you could use a symbolic link pointing at the desired root directory.

Maybe mod_rewrite also could be used to achive something similar.

/hd
Bondings
Maybe not a fancy solution, but mod_rewrite should be able to do this.

1)Add the domain like it should, like a separate domain in DirectAdmin. (I understood that you already did that)
2)Create a file called ".htaccess" in the public_html directory of that domain.
3)Put the following code (after changing it a bit) in your .htaccess file:
Code:
RewriteEngine On

RewriteRule ^(.*) http://<direct-url-to-the-subfolder>/$1 [L,NC]


The server should then execute all requests for the domain like they would have been direct requests for the subfolder. The user requesting the website, won't know that you are using mod_rewrite.

http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
http://www.sitepoint.com/article/guide-url-rewriting
http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.png
Related topics
Cpanel & DirectAdmin
[RESOLVED] trying to host a .com.au domain! help found!
How to config domain setting in DirectAdmin
Addon Domains?
New Domain Name hosting with FriHost
New Domain -Solved-
Domain Pointers thru DirectAdmin?
Php parsing error! Need help
Why is my domain still on directadmin but the site isn't
host web.id domain
Domain setup question...
need free domain
Webhosting on own domain
Domain Basics @ Frihost & DirectAdmin
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.