Hey folks. I’ve been trying to get subdomain redirects working, and I haven’t had any luck.
I tried the 3 subdomain plugins, and none of them seemed to work. Something, somewhere is 301ing me before any of them kick in.
If I make a simple test.php and put this in it
if (stristr($_SERVER[“HTTP_HOST”], ‘test’))
header( ‘Location: http://www.google.com/‘ ) ;
and go to http://test.mysite.com/test.php, I do in fact get dumped to google. So that’s a start.
Using the Automatic Subdomains plugin, nothing happens.
Looking at its code, it’s fairly simple.
And then in tjg_as_get_subdomain, it tries to figure out whether or not it needs to do a redirect.
The PROBLEM is that I’ve already been 301’d out of test.mysite.com and into mysite.com before tjg_as_get_subdomain ever fires. I put that code snippet from test.php in that function, and I’m getting sent to mysite.com, not google.
So something is killing my subdomains before any of these plugins can kick in. It can’t be my server, since my test.php worked: clearly the subdomain is coming through to PHP. So it’s got to be something in WP? Right? Any ideas?
- The topic ‘Subdomains’ is closed to new replies.