I’ve tried $_SERVER[‘HTTP_REFERER’] but it’s always empty.
Sure because it got redirected via WP to that page so the referrer is itself. Love that logic.
I wonder if this workaound would be it: http://frumph.net/2010/06/05/wordpress-3-0-multisite-subdomain-installation-noblogredirect-behavior-fix/
No, it doesn’t work for me, so I’ve decide to go different way. This is my htaccess:
RewriteCond %{HTTP_HOST} !^(www|ws)\. [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.[^.]+\.[^.]+$
RewriteRule ^(.*)$ http://www.MYDOMAIN.com/check.php$1?username=%1 [QSA,L,R=301]
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
Now, in check.php I have basics:
$username = $_REQUEST["username"];
if ( username_exists( $username ) )
echo "In Use - load content";
else
echo "Not In Use... serve my predefined content";
Now even if blog exist – I am not sure how to trick .htaccess to proceed with loading actual blog and if it doesn’t exist I would like to serve content in wordpress manner…
e.g: blog.mydomain.com exist and user will see actual blog and test.mydomain.com doesn’t exist, but I would like visitor to be on test.mydomain.com and serve him some content. Is this possible ?
Not with no-blog-redirect. It’s literally redirecting. If you left the page alone it would go to example.com/wp-signup.php?new=test
And then you could customize the signuppage.