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.

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

How to disable sapphire/silverstripe framework in directory


Go to End


10 Posts   4133 Views

Avatar
Dolza

Community Member, 10 Posts

14 January 2010 at 8:34am

i read it somewhere, at somepoint in time, but i can't find it again....
how do you disable the sapphire framework for a directory?

example:
I have my site in public_html/
I made a subdomain dev.mysite linked to public_html/dev
I don't want sapphire/silverstripe running in this directory.

Avatar
Willr

Forum Moderator, 5523 Posts

14 January 2010 at 9:02am

You can add a condition to the .htaccess rule for it to ignore requests to a given directory.

Add this in your .htaccess file above the RewriteRule.

RewriteCond %{REQUEST_URI} !^/phpmyadmin/.*

Avatar
Dolza

Community Member, 10 Posts

17 November 2010 at 5:02am

This method no longer seems to work with the current build
Is there another way to accomplish this now?

<Files *.ss>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
</Files>

<Files web.config>
	Order deny,allow
	Deny from all
</Files>

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !^/phpmyadmin/.*
	RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>

Avatar
dompie

Community Member, 88 Posts

17 November 2010 at 10:27pm

We have the following solution for this problem:

RewriteCond %{REQUEST_URI} !http://you.domain.com/directory

Avatar
Dolza

Community Member, 10 Posts

18 November 2010 at 8:51am

just tried this with both the directory and exact page names as the rewrite condition, in both cases, the framework is still being applied

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !http://domain.com/post/page.ext
	RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !http://domain.com/post/
	RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>

Avatar
(deleted)

Community Member, 473 Posts

18 November 2010 at 10:20am

Personally, I just put a .htaccess in the subdirectory containing:

RewriteEngine Off

Also, if you are using mod_rewrite in the subdirectory, ensure that your rules have the L (last) flag.

Avatar
Dolza

Community Member, 10 Posts

18 November 2010 at 10:26am

Edited: 18/11/2010 10:39am

rewrite off is the first thing i tried, is semi-applies the framework, no template, but it always shows the "home" page - assuming you use that in conjunction with the previous suggestion. If rewrite off is used alone, nothing changes what so ever and the full framework is applied and it shows page not found with your template/theme.

Avatar
Dolza

Community Member, 10 Posts

18 November 2010 at 10:46am

Edited: 18/11/2010 11:04am

I appologize, the semi- thing was something else I tried previously.
Rewrite off does nothing

http://reiip.com/post/

public_html/.htaccess

### SILVERSTRIPE START ###
<Files *.ss>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
</Files>

<Files web.config>
	Order deny,allow
	Deny from all
</Files>

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_URI} ^(.*)$
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_URI} !http://reiip.com/post/ 
	RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###
AddType application/download pdf

public_html/post/.htaccess

RewriteEngine Off

Go to Top