My b2evolution Version: 2.x
I have created an A record that is *.grblogs.com It works fine.
I have a .htaccess in the root directory that has this in it:
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.grblogs\.com?$
RewriteCond %{HTTP_HOST} ^([^.]+)\.grblogs\.com?$
RewriteRule ^$ http://www.grblogs.com/index.php/%1 [L]
It does not redirect http://bigd.grblogs.com to http://www.grblogs.com/index.php/bigd
Interesting note: if I make the last line something like
RewriteRule ^$ http://www.grblogs.com/index2.php/%1 [L]
to cause an error by calling index2.php that is not on the server.
I get this error message so I can see the redirect is rewriting with the Cname, just not loading the page.
=============
The requested URL /index2.php/bigd was not found on this server.
============
I don't want to use another method. I want to get this to work. Thanks
All the best,
-Jon
Goes in your .htaccess file.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(.+)\.yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/index.php/%1 [R=301,L]
This is the code that should work if you want to make:
somename.yourdomain.com => www.yourdomain.com/index.php/somename
:D