I am trying to access my silverstripe installation using a subdomain and I'm not having much luck. I know it's an issue with .htaccess but I've been looking at the documentation on the apache site and it's just not clicking.
Here's my setup -
Host: godaddy.com
Main site: http://www.unclebubby.com
Silverstripe install: http://www.unclebubby.com/wavs2 (wavs2 is the subdir where SS is installed)
Desired access: http://wavs.unclebubby.com or http://wav.unclebubby.com
wavs.unclebubby.com currently points to a bunch of redirect pages under a subdir named /wavs. wav.unclebubby.com currently points to the SS install under the /wavs2 subdir.
Current .htaccess file (default):
### SILVERSTRIPE START ###
RewriteEngine On
RewriteBase /wavs2
RewriteCond %{REQUEST_URI} !(^/wavs2$)|(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###
As it is, if I access it directly (www.unclebubby.com/wavs2) it works fine. If I try to access via subdomain (wav.unclebubby.com/wavs2) I get a 404 error which states "The requested URL /wavs2/sapphire/main.php was not found on this server." I worked with someone for a little bit in the chat room last night. They suggested changing the RewriteBase from /wavs2 to mydomain.com/wavs2. I tried several iterations including unclebubby.com/wavs2, www.unclebubby.com/wavs2, /unclebubby.com/wavs2, etc. I didn't try the subdomain with any of those changes because each one I tried broke direct access (www.unclebubby.com/wavs2) with a 500 internal server error.
I've looked at the execution pipeline document (http://doc.silverstripe.org/doku.php?id=execution-pipeline&s=htaccess), which led me to the mod_rewrite documentation (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html), which led me to the URL rewriting guide (http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html). I think I have an elementary grasp of what the .htaccess file is doing but I can't figure out how to get it to do what I -want- it to do, which is allow me to access the site directly or via either subdomain.
I know I'm not the only one who has experienced this but the answers I've found/been given so far have been vague or have not produced the desired results. ANY help is appreciated.
Thanks,
Joe