Skip to content

Instantly share code, notes, and snippets.

Karl Ward mjau-mjau

Block or report user

Report or block mjau-mjau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!-- INTRO -->
<div class="index-intro">
<div class='index-intro-text'>
<h1>The Ultimate Photo Gallery Website</h1>
<h2>X3 is a complete photo gallery website for photographers and artists. Designed to look amazing on all devices, X3 comes loaded with features!</h2>
</div>
<div class="index-intro-image">
<picture>
<source srcset="{{files}}/images/x3-photo-gallery.webp 1x, {{files}}/images/x3-photo-gallery-2x.webp 2x" media="(max-width: 535px)" type="image/webp">
@mjau-mjau
mjau-mjau / get_domain.php
Last active Mar 17, 2018
PHP get primary domain
View get_domain.php
<?php
function get_domain($host){
$myhost = strtolower(trim($host));
$count = substr_count($myhost, '.');
// www.(domain.com) || (domain.co.uk) || sub.(domain.com)
if($count === 2){
if(strlen(explode('.', $myhost)[1]) > 3) $myhost = explode('.', $myhost, 2)[1];
@mjau-mjau
mjau-mjau / hiawatha.conf
Created Jun 28, 2017
Hiawatha Server configuration for X3
View hiawatha.conf
UrlToolkit {
ToolkitID = imagevuex3test
# Deny access to config and _cache folder
Match ^/test/(config|_cache) DenyAccess
# No rewrite for existing files
RequestURI isfile Return
# Rewrite any calls to html|json|xml|atom|rss if a folder matching * exists
@mjau-mjau
mjau-mjau / .htaccess
Last active May 30, 2017
Apache deny access to directory
View .htaccess
# Deny access to all files in folder
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
View lighttpd.conf
# Rewrite any calls to html|json|xml|atom|rss if a folder matching * exists
url.rewrite-if-not-file = (
"(.+)\.(html|json|xml|atom|rss)$" => "$1/"
)
# Rewrite any calls to /render to the X3 image resizer
url.rewrite-once = (
"^render/." => "app/parsers/slir/"
)
@mjau-mjau
mjau-mjau / nginx.conf
Last active Dec 20, 2018
X3 NGINX config
View nginx.conf
server {
# Basic NGINX site setup
listen 80;
server_name yourwebsite.com;
# Location where X3 is installed
root /var/www/yourwebsite;
# index.php as index
@mjau-mjau
mjau-mjau / .htaccess
Last active May 31, 2017
X3 .htaccess file for Apache with only required rules
View .htaccess
# ---------------------------------------------------------------------------
# X3 REQUIRED
# Below rewrite rules are strictly required by X3 for pages to work properly.
# ---------------------------------------------------------------------------
<IfModule mod_rewrite.c>
# RewriteEngine
RewriteEngine on
@mjau-mjau
mjau-mjau / .htaccess
Last active Jun 25, 2018
X3 Default .htaccess file for Apache server
View .htaccess
# ---------------------------------------------------------------------------
# X3 REQUIRED
# Below rewrite rules are strictly required by X3 for pages to work properly.
# Add custom rules inside "# custom rules start" and "# custom rules end" tags.
# ---------------------------------------------------------------------------
<IfModule mod_rewrite.c>
# RewriteEngine enabled
@mjau-mjau
mjau-mjau / httpd.conf
Last active Jun 7, 2017
X3 Extended Apache config file example
View httpd.conf
# X3 extended Apache configuration example similar to what we use on our own Apache hosting.
# Some of the non-X3-specific rules may already be applied to your server by default.
# Find more standard Apache default here: https://github.com/h5bp/server-configs-apache/blob/master/dist/.htaccess
# Redirect non-SSL requests (both www and non-www) to HTTPS website [OPTIONAL]
<VirtualHost *:80>
ServerName yourwebsite.com
ServerAlias www.yourwebsite.com
Redirect permanent / https://yourwebsite.com/
@mjau-mjau
mjau-mjau / httpd.conf
Last active Apr 3, 2017
X3 Apache config file
View httpd.conf
# Basic X3 Apache config file (minimum requirements).
<VirtualHost *:80 *:443>
# Set serverName and DocumentRoot
ServerName yourwebsite.com
DocumentRoot /var/www/yourwebsite
# X3 specific rules applied relative to X3 root directory
You can’t perform that action at this time.