Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-06-2010, 07:25 PM   #1
gwidomains
Confirmed User
 
Join Date: May 2007
Posts: 426
.htaccess Q -- redirect subdomain page to main domain page

How do I use .htaccess 301 redirect to

Redirect a subdomain page to main domain page?

I have a bunch of pages on sub-domain page i need to redirect individually to different pages.

gwidomains is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2010, 07:40 PM   #2
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Code:
RewriteCond %{HTTP_HOST} !^sub\.domain\.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2010, 08:00 PM   #3
gwidomains
Confirmed User
 
Join Date: May 2007
Posts: 426
Quote:
Originally Posted by spacedog View Post
Code:
RewriteCond %{HTTP_HOST} !^sub\.domain\.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]
i think that is for all pages on the sub domain though. I need to assign them individually... that's the problem :/

thx for the attempt though spacedog.
gwidomains is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2010, 08:32 PM   #4
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteCond %{HTTP_HOST} ([^*]+)\.domain\.com [NC]
RewriteRule ^(.*)$ script.php?x=%1 [NC]

where %1 will be everything before .domain.com

so if its one.two.three.domain.com it will go to domain.com/script.php?x=one.two.three
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2010, 09:00 PM   #5
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
horrible examples :p
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-06-2010, 09:03 PM   #6
gwidomains
Confirmed User
 
Join Date: May 2007
Posts: 426
Quote:
Originally Posted by fris View Post
horrible examples :p
gwidomains is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.