From 9d2f18d4c485a8045c5d97e3914b77605515848a Mon Sep 17 00:00:00 2001 From: axllent Date: Thu, 21 Jan 2016 11:41:13 +1300 Subject: [PATCH] Notes regarding changes to .htaccess Fixes #1 --- README.md | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b90e27c..0f138f4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # SimpleMDE Editor & Markdown for SilverStripe 3 -This module adds a field and a data type that allows for Markdown editing in the CMS, and HTML template rendering -using the Github Flavoured Markdown parser [Parsedown](http://parsedown.org/). +This module adds a field and a data type that allows for Markdown editing in the CMS, and HTML template rendering using the Github Flavoured Markdown parser [Parsedown](http://parsedown.org/). -It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor) -for CMS editing (see "Editor limitations" below). +It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor) for CMS editing (see "Editor limitations" below). ## Requirements - SilverStripe 3.x @@ -41,35 +39,30 @@ class MyMarkdownPage extends Page ``` ### .htaccess: - -The JavaScript and CSS resources needed to show the editor is unfortunately installed in the `vendor` folder. By -default, SilverStripe blocks all HTTP requests to it (note that we do not want to include the dependencies directly -because we want Composer to handle those dependencies). In order to get this to work, we'll need to allow access to -those resources. +The JavaScript and CSS resources needed to show the editor is unfortunately installed in the `vendor` folder. By default, SilverStripe blocks all HTTP requests to it (note that we do not want to include the dependencies directly because we want Composer to handle those dependencies). In order to get this to work, we'll need to allow access to those resources. Add the following line: + ``` - RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ +RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ ``` + above this line: + ``` - RewriteRule ^vendor(/|$) - [F,L,NC] +RewriteRule ^vendor(/|$) - [F,L,NC] ``` -So that the `.htaccess` file would look similar to the following: + +so that the `.htaccess` file would look similar to the following: + ``` -... - # Deny access to potentially sensitive files and folders - RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ - RewriteRule ^vendor(/|$) - [F,L,NC] - - RewriteRule silverstripe-cache(/|$) - [F,L,NC] - RewriteRule composer\.(json|lock) - [F,L,NC] -... +# Deny access to potentially sensitive files and folders +RewriteCond %{REQUEST_FILENAME} !\.(js|css)$ +RewriteRule ^vendor(/|$) - [F,L,NC] + +RewriteRule silverstripe-cache(/|$) - [F,L,NC] +RewriteRule composer\.(json|lock) - [F,L,NC] ``` ## Editor limitations: -SimpleMDE has some nice features such as full-page editing/preview, as well as "Side by Side" editing -[see demo](http://nextstepwebs.github.io/simplemde-markdown-editor/). Unfortunately this doesn't play nice with -SilverStripe's CMS as the fullscreen elements are positioned statically. Rather than some ugly hacking, and until -someone hopefully finds an elegant solution (pull requests please), fullscreen & side-by-side functionality has been -hidden from the toolbar. +SimpleMDE has some nice features such as full-page editing/preview, as well as "Side by Side" editing [see demo](http://nextstepwebs.github.io/simplemde-markdown-editor/). Unfortunately this doesn't play nice with SilverStripe's CMS as the fullscreen elements are positioned statically. Rather than some ugly hacking, and until someone hopefully finds an elegant solution (pull requests please), fullscreen & side-by-side functionality has been hidden from the toolbar.