Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 9d2f18d

Browse files
committed
Notes regarding changes to .htaccess
Fixes #1
1 parent 24cdaa2 commit 9d2f18d

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

README.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# SimpleMDE Editor & Markdown for SilverStripe 3
2-
This module adds a field and a data type that allows for Markdown editing in the CMS, and HTML template rendering
3-
using the Github Flavoured Markdown parser [Parsedown](http://parsedown.org/).
2+
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/).
43

5-
It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor)
6-
for CMS editing (see "Editor limitations" below).
4+
It is integrated with the [SimpleMDE Markdown Editor](https://github.com/NextStepWebs/simplemde-markdown-editor) for CMS editing (see "Editor limitations" below).
75

86
## Requirements
97
- SilverStripe 3.x
@@ -41,35 +39,30 @@ class MyMarkdownPage extends Page
4139
```
4240

4341
### .htaccess:
44-
45-
The JavaScript and CSS resources needed to show the editor is unfortunately installed in the `vendor` folder. By
46-
default, SilverStripe blocks all HTTP requests to it (note that we do not want to include the dependencies directly
47-
because we want Composer to handle those dependencies). In order to get this to work, we'll need to allow access to
48-
those resources.
42+
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.
4943

5044
Add the following line:
45+
5146
```
52-
RewriteCond %{REQUEST_FILENAME} !\.(js|css)$
47+
RewriteCond %{REQUEST_FILENAME} !\.(js|css)$
5348
```
49+
5450
above this line:
51+
5552
```
56-
RewriteRule ^vendor(/|$) - [F,L,NC]
53+
RewriteRule ^vendor(/|$) - [F,L,NC]
5754
```
58-
So that the `.htaccess` file would look similar to the following:
55+
56+
so that the `.htaccess` file would look similar to the following:
57+
5958
```
60-
...
61-
# Deny access to potentially sensitive files and folders
62-
RewriteCond %{REQUEST_FILENAME} !\.(js|css)$
63-
RewriteRule ^vendor(/|$) - [F,L,NC]
64-
65-
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
66-
RewriteRule composer\.(json|lock) - [F,L,NC]
67-
...
59+
# Deny access to potentially sensitive files and folders
60+
RewriteCond %{REQUEST_FILENAME} !\.(js|css)$
61+
RewriteRule ^vendor(/|$) - [F,L,NC]
62+
63+
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
64+
RewriteRule composer\.(json|lock) - [F,L,NC]
6865
```
6966

7067
## Editor limitations:
71-
SimpleMDE has some nice features such as full-page editing/preview, as well as "Side by Side" editing
72-
[see demo](http://nextstepwebs.github.io/simplemde-markdown-editor/). Unfortunately this doesn't play nice with
73-
SilverStripe's CMS as the fullscreen elements are positioned statically. Rather than some ugly hacking, and until
74-
someone hopefully finds an elegant solution (pull requests please), fullscreen & side-by-side functionality has been
75-
hidden from the toolbar.
68+
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.

0 commit comments

Comments
 (0)