Jump to:

23376 Posts in 18278 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » How to disable sapphire/silverstripe framework in directory

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

Page: 1 2
Go to End
Author Topic: 1998 Views
  • Dolza
    Avatar
    Community Member
    10 Posts

    How to disable sapphire/silverstripe framework in directory Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

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

  • Dolza
    Avatar
    Community Member
    10 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

    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>

  • dompie
    Avatar
    Community Member
    88 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

    We have the following solution for this problem:

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

  • Dolza
    Avatar
    Community Member
    10 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

    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>

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

    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.

  • Dolza
    Avatar
    Community Member
    10 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

    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.

  • Dolza
    Avatar
    Community Member
    10 Posts

    Re: How to disable sapphire/silverstripe framework in directory Link to this post

    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

    1998 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.