coreiho/silverstripe-installer/master/.htaccess - Htaccess File

coreiho/silverstripe-installer/master/.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>

# This denies access to all yml files, since developers might include sensitive
# information in them. See the docs for work-arounds to serve some yaml files
<Files ~ ".ya?ml$">
  Order allow,deny
  Deny from all
</Files>

ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>
  SetEnv HTTP_MOD_REWRITE On
  RewriteEngine On

  # Modify the RewriteBase if you are using Silverstripe in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/silverstripe uncomment and
  # modify the following line:
  # RewriteBase /silverstripe

  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase '/'

  # To redirect all users to a specific domain.
  # (http://thisexample.com/... will be redirected to http://thatexample.com/...)
  # uncomment the following and replace "domainname.com" with the appropriate domain.
  # RewriteCond %{HTTP_HOST} !domainname.com$ [NC]
  # RewriteRule ^(.*)$ http://domainname.com/$1 [L,R=301]

  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} .
  # RewriteCond %{HTTP_HOST} !^www. [NC]
  # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
  # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

  RewriteRule ^vendor(/|$) - [F,L,NC]
  RewriteRule silverstripe-cache(/|$) - [F,L,NC]
  RewriteRule composer.(json|lock) - [F,L,NC]

  RewriteCond %{REQUEST_URI} ^(.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !.php$
  RewriteRule .* framework/main.php?url=%1 [QSA]

  RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule . %1/install.php? [R,L]

</IfModule>
### SILVERSTRIPE END ###

On Github License

Files

Download PDF of Htaccess file
ENV, HTTP_HOST, protossl, REQUEST_FILENAME, REQUEST_URI

Comments

Apache