Search Engine Optimization
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsSearch Engine StrategiesSearch Engine Optimization

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old August 6th, 2004, 03:39 PM
tony1284 tony1284 is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 tony1284 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Challenging 301 redirect

I've posted this on a few other places, but I thought I could get some help from you guys as well.

Ok I have been looking on the internet for this answer but haven't found one. Here is the situation:

I have several domain names that all point to the same index file on my server. The file they point to is dynamic (index.php) Which serves different content based on what domain it is.

I would now like to do away with having multiple domains all pointing twards the same file and just redirect them to a master domain which will provide a sub folder for each domain pointing twards it.

Example:

Domain: http://www.bluewidget.com - 301 redirect to -> http://www.widget.com/blue

Domain: http://www.redwidget.com - 301 redirect to -> http://www.widget.com/red

*Just to remind you that http://www.bluewidget.com and http://www.redwidget.com both currently reference the same dynamic php file. And also, the sub folders (widget.com/blue) are already setup and ready to go. Its just the redirecting process im stuck on...

How can I do this redirect? some sort of mod re-write I beleive. Im just not sure on the exact code i need for the htaccess file

Thanks
Tony

Reply With Quote
  #2  
Old August 6th, 2004, 06:04 PM
SantaClaws SantaClaws is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 27 SantaClaws User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
With PHP + Apache:

PHP Code:
if (preg_match'/[^\.]*\.*([a-z]+)widget\.com/i'$_SERVER['HTTP_HOST'], $matches ))
 {
     
header'HTTP/1.1 301 Moved Permanently' );
     
header"Location: http://www.widget.com/{$matches[1]}/" );
     
header'Connection: close' );
 } 


Should work...

Reply With Quote
Reply

Viewing: SEO Chat ForumsSearch Engine StrategiesSearch Engine Optimization > Challenging 301 redirect


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT