GlowHost Web Hosting Forums  

Go Back   GlowHost Web Hosting Forums > In The Lounge > Programming Talk
Register Forum FAQ Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-27-2005
Almost no longer a newbie!
 
Join Date: Apr 2005
Posts: 4
Rep Power: 0
Eric4 is on a distinguished road
Default The Mod Rewrite Thread - using apache to rewrite urls

If you park a domain using cPanel, by default the parked_domain is displayed by the browser address bar. If you prefer to display the main_domain, add this to your .htaccess file.

Code:
 
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?parked_domain\.com [NC] 
RewriteRule ^(.*)$ http://www.main_domain.com/$1 [R=301,L]
Replace "parked_domain" and "main_domain" with your actual domain names.

Cheers,
Eric4

Last edited by Matt; 12-27-2006 at 12:04 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-16-2005
trickyBizzness's Avatar
Practically a Glow Sage
 
Join Date: Jul 2005
Posts: 20
Rep Power: 0
trickyBizzness is on a distinguished road
Default

Why would someone want to do this? I thought the point of a parked domain was so that you could surf the same site under 2 different domains?
__________________
Hi!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-10-2005
Matt's Avatar
chown -R us.us *YourBase*
 
Join Date: Jan 2005
Location: Moved to Florida!
Posts: 1,725
Rep Power: 10
Matt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of lightMatt is a glorious beacon of light
Default

You can also use the parked domain function in cPanel to achieve a similar thing as the original poster mentioned, with a bit less technical work for you that don't want to get your hands as dirty.

On another note, here is one that will allow you to make all requests to your site have "www" in front of it. All sites we host by default can be accessed with and without the www, but some of you would like "www" only style urls.

Code:
 
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
Of course, you need to substitute "yourdomain.com" with your actual domain name.
__________________
:::::
01001100 00110011 00110011 00110111
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 post new threads
You may not post replies
You may not post attachments
You may 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 -5. The time now is 07:52 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO
Copyright 2000-2007 GlowHost.com