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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Allowing non-SS subfolders


Go to End


3 Posts   5587 Views

Avatar
sarahk

Community Member, 46 Posts

30 April 2008 at 11:34am

This came up about a year ago and I'd hoped it would be addressed by now.

I have created a subdomain to manage some content. Lets call it content.mysite.com

My hosting creates a folder called public_html/content/ and all the scripts, images etc go in there.

I've got SS sitting in public_html but it won't allow me access to either the subdomain or the folder.

Is there a marker file I can put in my "content" folder to tell SS to ignore it?

thanks

Sarah

Avatar
3dkiwi

Community Member, 18 Posts

30 April 2008 at 12:05pm

Sarah

I actually have a complete ss installation in a sub directory of a ss installation. To make sure the top ss installation passes all requests for the lower one I have the following .htaccess file in the top ss installation:

RewriteEngine On

RewriteBase /

RewriteRule ^familytrees$ familytrees/ [R,L]
RewriteRule ^familytrees/(.*)$ familytrees/$1 [L]

### SILVERSTRIPE START ###
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]
### SILVERSTRIPE END ###

The RewriteRules means that any request coming in that starts with /familytrees is passed through to the lower ss installation in the familytrees subdirectory. All other requests are handled by the normal ss handler.

Check out www.pyenet.co.nz and www.pyenet.co.nz/familytrees to see the effect.

HTH
3d

Avatar
sarahk

Community Member, 46 Posts

30 April 2008 at 1:15pm

works a treat

thank you

:)