Web Hosting Forums

Web Hosting

Discussion Forums

HowTo Park a domain on a subdirectory

This is a discussion on HowTo Park a domain on a subdirectory within the HowTo Tutorials for web hosting forums, part of the Virtual Hosting Forums category; First, in CPANEL, park the domain on your account. Next, add this to your .htaccess file in your public_html dir. ...


Go Back   Web Hosting Forums > Virtual Hosting Forums > HowTo Tutorials for web hosting

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 03-31-2007, 11:02 AM
michael_s's Avatar
AABox Staff
 
Join Date: Dec 2003
Posts: 89
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default HowTo Park a domain on a subdirectory

First, in CPANEL, park the domain on your account.

Next, add this to your .htaccess file in your public_html dir. Remeber to replace www.domain. with your actual domains.

Code:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.domain.* 
RewriteCond %{REQUEST_URI} !/subdir/
RewriteRule ^(.*)$ /subdir/$1
RewriteCond %{HTTP_HOST} ^domain.*
RewriteCond %{REQUEST_URI} !/subdir/
RewriteRule ^(.*)$ /subdir/$1
Replace www.domain.* (4th line) and domain.* (7th line) with the actual domain name of the pointer (minus the \'www.\' in the second instance). Do not put .com or .co.uk on it; keep the asterisk. Also replace the four instances of \"subdir\" with the name of the actual subdirectory on YOUR site that domain pointer will map to.

This will redirect requests for the domain pointer (both domain.com and www.domain.com) to the directory specified.

You can edit the .htaccess file at cpanel-> filemanager option in cpanel, or use FTP to download and edit the .htaccess file.
__________________
Michael Sasek
AABox Staff
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 10-02-2007, 04:31 AM
Junior Member
 
Join Date: Sep 2007
Posts: 1
Rep Power: 0
Golden Angel is on a distinguished road
Thumbs up Re: HowTo Park a domain on a subdirectory

This is a great post,it certainly makes a good point with the step by step information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-28-2007, 03:18 PM
michael_s's Avatar
AABox Staff
 
Join Date: Dec 2003
Posts: 89
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: HowTo Park a domain on a subdirectory

It is a regular expression and it is not a wildcard in this instance. In RegEx speak, a * means "Preceeding item must match zero or more times."
__________________
Michael Sasek
AABox Staff
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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 On
Pingbacks are On
Refbacks are On


All times are GMT -8. The time now is 07:50 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright ©2002-2008 AABox Web Hosting