On my site, I've got Wordpress in www.mydomain.co.uk, I've got a search engine on find.mydomain.co.uk, and I've got subusers on a wildcard with a script in a subdirectory to work out what to serve, based on the subdomain.
In cpanel, I have, for the subdomain redirect:
*.mydomain.co.uk /mydomain
find.mydomain.co.uk /mydomain/find
in htaccess of the site http document root, I have
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9][-a-z0-9]+)\.mydomain.co.uk\.co.uk(:80)?$ [NC]
RewriteCond %{HTTP_HOST} !^www\.mydomain\.co.uk
RewriteRule ^$ subdomainscript/ [L]
www.mydomain.co.uk brings up wordpress user2.mydomain.co.uk brings up user 2's page user2.mydomain.co.uk/page1 brings up user 2's page1 find.mydomain.co.uk brings up the search engine.
So for, all well and good. But....
The problem comes with
find.mydomain.co.uk/anydirectory = 500 internal server error.
What's doing my nut in is that find.mydomain.co.uk/test.html will work but find.mydomain.co.uk/directory/test.html gives a 500.
I promise that before coming and asking, I spent my Sunday looking through FAQs and forums. I just can't get my head around mod rewrites and regexp stuff. I have a feeling that I might need to delete the "find" subdomain redirect in cpanel and do it all in .htaccess as there's the wildcard subdomain.
However, although I can find tutorials on wildcards and wildcards with one subdomain, a day's googling has turned up nothing that works for www, two subdomains AND wildcards for anything which isn't those two subdomains.
Any help would be greatly appreciated.