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!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Web Hosting and Domains > Web Hosting Forum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-2007, 17:46
Junior Member
 
Join Date: Jan 2007
Posts: 24
Default mod_rewrite rule to point parked domain to an addon domain

Hi all.

Just thought I'd let you know a solution to a problem that I recently encountered.

A parked domain is for the root domain only, so if your root domain is called whatever.com, you can create a parked domain called whateverelse.com. When you visit whateverelse.com you will see the contents of whatever.com.

The problem is that you can't create a parked domain that shows the contents of an addon domain. For example, if you create an addon domain called addon.com, you can't then create a parked domain called addon.co.uk that shows the contents of addon.com.

You can ask eukhost to make the necessary server configuration changes to allow this to happen, but you could also use mod_rewrite to achieve the same.

Simply create your addon domain, then create your parked domain. Assuming the above example domain names, add the following to the .htaccess file that resides in the public_html directory:

Code:
# Parked domains for addon.com addon domain.
RewriteCond %{HTTP_HOST} ^addon\.co\.uk [OR]
RewriteCond %{HTTP_HOST} ^www\.addon\.co\.uk
RewriteCond %{REQUEST_URI} !^/addon/
RewriteRule ^(.*) /addon/$1
So, when you visit addon.co.uk or www.addon.co.uk you will see the contents of addon.com. Note that this is different to a redirect because the domain name does not change in the browser's location bar.

If you need to add more subdomains to addon.co.uk, simply duplicate the line that contains the www and change the www to be whatever subdomain you need.

You could alternatively use the following, which catches all subdomains:

Code:
# Parked domains for addon.com addon domain.
RewriteCond %{HTTP_HOST} ^.*\.?addon\.co\.uk
RewriteCond %{REQUEST_URI} !^/addon/
RewriteRule ^(.*) /addon/$1
Hope this is helpful to someone.

Steph(an)

Last edited by brighter; 06-03-2007 at 18:59. Reason: Added extra detail about catching all subdomains.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-03-2007, 18:49
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,773
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com Send a message via Skype™ to eUKhost.com
Default

Thats really good tutorial

Thanks Stephan !
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
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 Search this Thread
Search this Thread:

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


All times are GMT. The time now is 11:38.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

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

Customer Testimonials
eUK Customer Testimonials


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


popular blog categories


Web Hosting
Website Hosting articles

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

Web Hosting
Web Hosting Service