I'm currently using my SilverStripe website on a shared cPanel hosting account, however when I install my SilverStripe website to the public_html directory any subdomains/add-on domains (in a separate folder off the public_html folder) comes up with an error message relating to the SilverStripe website.
Removing the .htaccess file enables all the subdomains to work correctly but the SilverStripe website won't function.
If anyone has any simple hack or something I can put in the .htaccess file to work around this it'd be great.
When I try access a subdomain/parked domain that is hosted in a folder (lets say site1) off the root side where SilverStripe is located I get the following:
The requested URL /home/username/public_html/sapphire/main.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
If I was to go and type in mydomain/foldername I get the CMS show up with a 'Page not Found' message, however if I remove the .htaccess file everything except the CMS works perfectly. This could probably be resolved with a couple of lines of code in the .htaccess file but I'm already way out of my depth.
18 September 2007 at 7:13pm
Core Development Team,
While .htaccess files won't affect the domain, that's only because normally sub-domains are kept in separate folders.
With cPanel and some other hosting packages, the root of the site is public_html, with subdomains being created as directories under public_html.
.htaccess inherits in a similar manner to classes - if it can't find a .htaccess in the current directory (say public_html/site1), it'll look in the parent directory (public_html), all the way back up until it either finds a file, or reaches the web root.
In your case, it might be as simple as dropping a blank .htaccess file into your other sub-domains? If I recall correctly, Apache will stop looking for .htaccess files once it's found one.
I had a similar problem until I realised that I had created the other accounts not necessarily incorrectly but there was a better way. I have cpanel but also the option for WHM management and this has a create account option. from here if you have multiple domain names you create a whole new account which sits underneath your main account but has its own folder and access. this worked for me don't know if you have the same but just thought it might help.