UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  eUKhost's Official Web Hosting Forum > Technical Support > VPS Hosting - Virtual Private Servers

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-10-2009, 16:29
Senior Member
 
Join Date: Apr 2009
Posts: 107
Default 'redirect' main-domain document-root to subdomain

Please don't do anything to my account based on this question.
It is only theoretical at this point.


In WHM, is there a way to change the document root for the main domain of an account?
In other words, I'd like mydomain.com to 'redirect' to the subdirectory
main.mydomain.com (where the CMS will be installed) but for the subdirectory
part of the url to be 'stealthed' so that the user would simply see mydomain.com in their
browser bar.

This htaccess script works:

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^$ main/index.php [L]
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/main%{REQUEST_URI} -f
RewriteRule .* main/$0 [L]
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* main/index.php?q=$0 [QSA]

But I'd prefer to do it in WHM if possible.

Or maybe I am better to edit the appropriate virtualHost line in httpd.conf ?
Or perhaps better to create a symbolic link: public_html -> main ?

Any advice about the best way to achieve the desired effect?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-10-2009, 01:14
Moderator
 
Join Date: Aug 2007
Posts: 161
Default

Hello,

Changing the document root & redirecting a domain, both are different procedures & none of them can be done through WHM. The result that you are expecting cannot be obtained from either of the options. The best way to get this working is to use URL MASKING. URL Masking means that the visitors to the domain name will be forwarded to the destination website, however the URL in the browser address bar will remain the same. Following is an example for URL Masking.



Code:
<frameset rows="100%">
  <frame src="http://www.main.mydomain.com/">
</frameset>
<noframes>
  Please follow <a href="http://www.mydomain.com/">link</a>!
</noframes>
You have to use the code in the index file of the main domain.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-10-2009, 09:48
Gallier's Avatar
Junior Member
 
Join Date: Sep 2009
Posts: 21
Default

Quote:
Originally Posted by -Anti- View Post
Please don't do anything to my account based on this question.
It is only theoretical at this point.


In WHM, is there a way to change the document root for the main domain of an account?
In other words, I'd like mydomain.com to 'redirect' to the subdirectory
main.mydomain.com (where the CMS will be installed) but for the subdirectory
part of the url to be 'stealthed' so that the user would simply see mydomain.com in their
browser bar.

This htaccess script works:

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^$ main/index.php [L]
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/main%{REQUEST_URI} -f
RewriteRule .* main/$0 [L]
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* main/index.php?q=$0 [QSA]

But I'd prefer to do it in WHM if possible.

Or maybe I am better to edit the appropriate virtualHost line in httpd.conf ?
Or perhaps better to create a symbolic link: public_html -> main ?

Any advice about the best way to achieve the desired effect?

Thanks.
maybe you need change DocumentRoot in httpd.conf

Code:
<VirtualHost IP:PORT>
	ServerName mydomain.com
	DocumentRoot /var/www/user/data/www/mydomain.com/main
	ServerAlias www.mydomain.com
	php_admin_value open_basedir "/var/www/user/data:."
        ....
        ....
</VirtualHost>
Try it )
__________________
Make your website the fastest one - Web Optimizer* web.stakh.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 01:52.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
UK Web Hosting by eUKHosting 3.1.0
UK Web Hosting by eUKHosting 3.1.0
Copyright © 2001-2012, eUKhost LTD. All rights reserved.

 


UK VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

VoIP Dedicated Servers
Asterisk, Trixbox Dedicated Servers

Business Web Hosting
100% uptime Hosting

UK Cpanel Hosting
cPanel Shared Hosting

Domain Hosting
Cheap Domains & Hosting Plans

UK Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

ColdFusion Hosting
ColdFusion Web Hosting
 
 

Android and Apple App


knowledgebase articles
eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting

Joomla Hosting
Joomla Web Hosting

Mambo Hosting
Mambo Web Hosting

Magento Hosting
Magento Web Hosting

Wordpress Hosting
Wordpress Web Hosting

 

Web Hosting Affiliate Program
 

popular blog categories

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles