Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Non SS Subdomain Issue


5 Posts   1062 Views


5 September 2009 at 5:27am (Last edited: 5 September 2009 5:28am), Community Member, 33 Posts

Under SS 2.2.x I was able to install a subdomain on a site and have it work separately from SS by modifying the .htaccess file to read:

RewriteEngine On
RewriteRule ^subdomaindirectory$ - [L]
RewriteRule ^subdomaindirectory/.* - [L]
RewriteBase /

RewriteCond %{REQUEST_URI} !(^$)|(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]

With the advents of 2.3 when I add a subdomain I receive the following message.

The requested URL /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 attempt to modify the .htaccess to include the following code as I did under 2.2 outlined above, this does not work.

RewriteRule ^subdomaindirectory$ - [L]
RewriteRule ^subdomaindirectory/.* - [L]

Any help would be appreciated. I really need to get this subdomain up and running!



28 September 2009 at 5:30am Community Member, 9 Posts

I have the same issue: ss 2.3.3 on root, non-ss on subdomain "shop". Will not work with subdomain at all, same error. Please assist! Thanks loads.


29 September 2009 at 10:26pm (Last edited: 29 September 2009 11:25pm), Community Member, 11 Posts

It looks like a lot of people are having this issue, including me!

BUT it looks like there is a simple solution, well, it worked for me. See this tread...



30 September 2009 at 12:26am (Last edited: 30 September 2009 5:09am), Community Member, 901 Posts

Just place your own .htaccess with your own rewrite rules in the subdomain folder. If you don't need URL rewriting, enter the following in the subdomain .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine Off

Edit: spelling


30 September 2009 at 4:09am Community Member, 9 Posts

Thank you so much, this one works for me, and I like it better than the previous because its so clean. You're a gem!