Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### PERFORMANCE ENHANCEMENTS ###
- # Remove Etags
- FileETag none
- # Add Vary-Encoding Header
- Header append Vary: Accept-Encoding
- # Make Default Charset set to UTF-8
- AddDefaultCharset UTF-8
- ########################### SIMPLESAML Rules ####################################
- RewriteCond %{HTTP_HOST} ^admin\..*$
- RewriteRule ^simplesaml/(.*)$ /silverstripe-ssp/thirdparty/simplesamlphp/simplesamlphp/www/$1 [L,PT]
- ######################### END SIMPLESAML RULES ##################################
- ### END PERFORMANCE ENHANCEMENTS ###
- ### ADMIN ROBOTS.TXT ###
- RewriteCond %{HTTP_HOST} ^admin\.
- RewriteRule ^robots\.txt$ /site/admin_robots.txt [L]
- ### BLOCK SEARCH ENGINES FROM THE ADMIN DOMAIN ###
- RewriteCond %{HTTP_HOST} ^admin\.
- RewriteCond %{REQUEST_URI} !^/site/admin_robots\.txt$
- RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
- RewriteCond %{HTTP_USER_AGENT} Bingbot [OR]
- RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
- RewriteCond %{HTTP_USER_AGENT} Slurp
- RewriteRule .* - [F,L]
- # Block Access to assets folder
- #RewriteRule ^(assets$)|(assets/$) page-not-found [L]
- ### SILVERSTRIPE START ###
- ######################################################################################################
- ### NOTE: If you add any get params MAKE SURE you add them AFTER {QUERY_STRING}! ###
- ### This ensures that these variables cannot be overwritten by users adding their own GET vars. ###
- ######################################################################################################
- ########## WEB FONTS #####################
- AddType font/ttf .ttf
- AddType font/eot .eot
- AddType font/otf .otf
- AddType font/woff .woff
- <FilesMatch "\.(ttf|otf|eot|woff)$">
- <IfModule mod_headers.c>
- Header set Access-Control-Allow-Origin "*"
- </IfModule>
- </FilesMatch>
- ######### END WEB FONTS ###################
- <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 *.yml>
- Order allow,deny
- Deny from all
- </Files>
- ErrorDocument 404 /assets/error-404.html
- ErrorDocument 500 /assets/error-500.html
- SetEnv HTTP_MOD_REWRITE On
- RewriteEngine On
- RewriteBase '/'
- # Deny access to potentially sensitive files and folders
- RewriteRule ^vendor(/|$) - [F,L,NC]
- RewriteRule silverstripe-cache(/|$) - [F,L,NC]
- RewriteRule composer\.(json|lock) - [F,L,NC]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^(.*).shtml$ $1 [R=301,L]
- #########################################################################################################
- ### The follwing lines are redirects for bad indexed urls to remove problem with dubble content pages ###
- #########################################################################################################
- # Disallow trailing slashes on all urls
- RewriteCond %{HTTP_HOST} !^admin\.(.+)$
- RewriteCond %{REQUEST_URI} ^(.+)/$
- Rewriterule ^(.+)/$ /$1 [R=301,L]
- # Block home url - silverstripe standard index page url
- RewriteRule ^index.html$ / [L,R=301]
- RewriteRule ^home$ / [L,R=301]
- ### URL BLOCKERS ###
- # Controller urls on non admin domains are blocked by Class BassModelAsController
- # Block "admin", "Security" and images (popup imageloader) urls from non admin domains.
- RewriteCond %{HTTP_HOST} !^admin\.
- #RewriteRule ^(Security)|(images$)|(images/$) page-not-found [L]
- RewriteRule ^(images$)|(images/$) page-not-found [L]
- # Block dev/build
- RewriteRule ^dev/build$ /page-not-found?isDev=1 [L]
- #Block conf folder
- RewriteRule ^example/conf.* [R=404,L]
- #Block setup.php
- RewriteRule ^setup.php [R=404,L]
- #Block log folder
- RewriteRule ^log/.* [R=404,L]
- # Block out access to dev and debug_profile
- RewriteCond %{QUERY_STRING} .*(isDev|debug_profile|debug_memory).* [NC]
- RewriteRule .* /? [R=301,L]
- # Block urls
- RewriteRule ^(.*)/silverstripe_version$ page-not-found [L]
- RewriteRule ^REVISION$ page-not-found [L]
- # Redirects that cannot be handled in the admin
- #Redirect 301 /form_2b.php? forms/entry-form?
- RewriteRule ^forms/form_2b.php(.*)$ forms/entry-form$1 [r=301,nc]
- RewriteCond %{REQUEST_URI} ^(.*)$
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_URI} !\.php$
- RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement