• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

301 redirect htaccess subdomain pages to main page

Hi,

I'd like to 301 redirect several subdomain pages to the main page (http://omusicstudios.com)

Here is the part of my htaccess:

Options +FollowSymLinks
RewriteEngine On

RewriteRule ^teachers/don.html$ /teachers/don.php
RewriteRule ^teachers/doug.html$ /teachers/doug.php
RewriteRule ^teachers/megan.html$ /teachers/megan.php
RewriteRule ^university.html$ /university.php
RewriteRule ^university-contact.html$ /university-contact.php

Open in new window

0
Victor Kimura
Asked:
Victor Kimura
2 Solutions
 
honestman31Commented:
in the each sub domain you want to redirect  go to folder www.domain.com/sub1/ 

and insert the following codes in htaccess  file  

redirect 301 / http://domain.com/.

copy that htaccess to every folder of the sub-domain you want to redirect
i.e  www.domain.com/sub2/
and www.domain.com/sub3/ 

and so on
0
 
arober11Commented:
If you just want a 301 rather than a 302 redirect simply add a [R=301] to the end of you rule. e.g.

RewriteRule ^teachers/don.html$ /teachers/don.php [R=301]

If you what to control the hostname seen in the browser just add it to the destination e.g.

RewriteRule ^teachers/don.html$ http://omusicstudios.com/teachers/don.php 


If you have some other requirement then please set out what you are trying to achieve in the format detailed in the "How to define your own Redirects or Rewrites: " section of this article: http://www.experts-exchange.com/A_4043.html then post it back here.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now