From f1468a2af8497db720dc850055fafb69a537235e Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Tue, 13 Dec 2016 00:00:38 +0100 Subject: [PATCH] [SITE] unify config between projects, updated htaccess --- .gitignore | 2 +- .htaccess | 7 +++-- robots.txt | 2 -- site/config/config.php | 53 ++++++++++++++++++++------------------ site/tags/html5youtube.php | 5 ++-- 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index 14b7ae0..06a35cd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ /video /publications -google*.html +google*.html \ No newline at end of file diff --git a/.htaccess b/.htaccess index fa0b3d6..c702ab0 100644 --- a/.htaccess +++ b/.htaccess @@ -9,10 +9,13 @@ RewriteBase / RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L] # block all files in the site folder from being accessed directly +# except for requests to plugin assets files +#RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N] +#RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.* RewriteRule ^site/(.*) index.php [L] -# block all files in the kirby folder from being accessed directly -RewriteRule ^kirby/(.*) index.php [L] +# block direct access to kirby and the panel sources +RewriteRule ^(kirby|panel\/app|panel\/tests)/(.*) index.php [L] # make panel links work RewriteCond %{REQUEST_FILENAME} !-f diff --git a/robots.txt b/robots.txt index 8d6a408..d261747 100644 --- a/robots.txt +++ b/robots.txt @@ -1,5 +1,3 @@ -# robots.txt for jannikbeyerstedt.de - User-agent: * Disallow: /kirby/ Disallow: /panel/ diff --git a/site/config/config.php b/site/config/config.php index 65aede4..73ce931 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -24,31 +24,6 @@ c::set('smartypants.doublequote.close', '“'); c::set('ssl', true); -c::set('routes', array( - array( - 'pattern' => 'sitemap.xml', - 'action' => function() { - return site()->visit('sitemap'); - } - ), - - // redirect legacy urls: - // feature/webdesign -> webdesign - // feature/fotografie -> fotografie - // feature/fotografie/(:any) -> fotografie/(:any) - array( - 'pattern' => 'feature/(:all)', - 'action' => function($uid) { - if (site()->find($uid)) { - $target = site()->find($uid)->url(); - header::redirect($target, 301); - }else { - go('error'); - } - } - ) -)); - /* Modules Configuration */ @@ -86,3 +61,31 @@ Piwik Plugin configuration c::set('spicy.piwik.active', true); c::set('spicy.piwik.url', 'https://jannikb.aquila.uberspace.de/piwik'); c::set('spicy.piwik.id', 2); + +/* +Routes +*/ +c::set('routes', array( + array( + 'pattern' => 'sitemap.xml', + 'action' => function() { + return site()->visit('sitemap'); + } + ), + + // redirect legacy urls: + // feature/webdesign -> webdesign + // feature/fotografie -> fotografie + // feature/fotografie/(:any) -> fotografie/(:any) + array( + 'pattern' => 'feature/(:all)', + 'action' => function($uid) { + if (site()->find($uid)) { + $target = site()->find($uid)->url(); + header::redirect($target, 301); + }else { + go('error'); + } + } + ) +)); diff --git a/site/tags/html5youtube.php b/site/tags/html5youtube.php index e7ce69a..2082bdb 100644 --- a/site/tags/html5youtube.php +++ b/site/tags/html5youtube.php @@ -6,10 +6,11 @@ * copyright: Jannik Beyerstedt | http://jannikbeyerstedt.de | code@jannikbeyerstedt.de * license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License * - * version 2.0.1 (09.01.2015) + * version 2.0.2 (12.12.2016) * changelog: * - v2.0: kirby 2 support * - v2.0.1: fix some html validation issues with & symbols + * - v2.0.2: html5 player is now default, so no url param needed any more */ kirbytext::$tags['html5youtube'] = array( @@ -18,7 +19,7 @@ kirbytext::$tags['html5youtube'] = array( ), 'html' => function($tag) { $base = 'https://www.youtube-nocookie.com/embed/'; - $end = '?rel=0&html5=1'; + $end = '?rel=0'; $videoID = $tag->attr('html5youtube'); $options = $tag->attr('options');