Skip to content

Instantly share code, notes, and snippets.

View foobartel's full-sized avatar

Holger Bartel foobartel

View GitHub Profile
@foobartel
foobartel / .htaccess
Created December 13, 2021 03:54
Apache .htaccess Redirect
<IfModule mod_rewrite.c>
# 301 REDIRECT HTTP TO HTTPS and WWW TO NON-WWW
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
</IfModule>
@foobartel
foobartel / copy-content-dir.sh
Created March 22, 2022 03:35
Copy Kirby Content Folder to keep Develop updated with production
#!/bin/sh
scp -R /server/path/to/production/tld/content /server/path/to/develop/tld/content
@foobartel
foobartel / config.php
Created May 31, 2022 02:09
Kirby Route Example - New homepage, other pages to 404
'routes' => [
[
'home' => 'other-page'
'pattern' => ['notes', 'notes/(:any)'],
'action' => function() {
if (! kirby()->user()) {
go('error');
}
$this->next();
}