2
   

301 redirect and all my subdomains now crazy!

 
 
Reply Tue 6 Sep, 2005 08:48 am
I recently did the 301 redirect to get my non www. pages to www. pages...and it works fine...all the search engines are now updating to the www. version.

however a problem from this is now all my subdomains are directing to their respective directories..

for example:

hotshots.mysite.com redirects to www.mysite.com/hotshots

how on earth do I fix this?

My .htaccess code is for the redirect is:

Code:Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^.*mysticalwonders\.org [NC]
RewriteRule (.*) http://www.mysticalwonders.org/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.mysticalwonders\.org
RewriteRule (.*) http://www.mysticalwonders.org/$1 [R=301,L]
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 1,699 • Replies: 4
No top replies

 
Craven de Kere
 
  1  
Reply Tue 6 Sep, 2005 10:14 pm
I don't think you get it. Your code says to redirect ANYTHING that is not www.yoursite.com

something.yoursite.com is NOT www.yoursite.com

You can add rules for each of your legitimate subdomains in series of conditions, or you can simply have apache house subdomain files outside of the domain's directory (this solution will likely need some server admin cooperation).
0 Replies
 
mwonders
 
  1  
Reply Tue 6 Sep, 2005 10:58 pm
Thanks..i fixed the problem by reducing the code on the root .htaccess to

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain\.com
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 6 Sep, 2005 11:01 pm
That doesn't look right to me. The code there would still not prevent a subdomain from redirecting under certain circumstances.
0 Replies
 
mwonders
 
  1  
Reply Wed 7 Sep, 2005 12:22 pm
Actually it works..all my subdomains are back to normal... hotshots.mysite.com,subdomain.mysite.com,etc...

They're all no longer redirecting..
only mysite.com to www.mysite.com which is what i set out to do with the redirect.... hopefully in about 2 weeks google drops all the non www versions...
0 Replies
 
 

Related Topics

In How much time a website can be developed? - Question by aussiejumpingcastle
Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » 301 redirect and all my subdomains now crazy!
Copyright © 2021 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 09/20/2021 at 09:00:10