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, Ed, biapar, Willr, Ingo, swaiba

Non SS Subdomain Issue

Go to End

5 Posts   1430 Views


Community Member, 33 Posts

5 September 2009 at 5:27am

Edited: 05/09/2009 5:28am

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!



Community Member, 9 Posts

28 September 2009 at 5:30am

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.


Community Member, 11 Posts

29 September 2009 at 10:26pm

Edited: 29/09/2009 11:25pm

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...


Community Member, 904 Posts

30 September 2009 at 12:26am

Edited: 30/09/2009 5:09am

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


Community Member, 9 Posts

30 September 2009 at 4:09am

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!