Skip to content

Instantly share code, notes, and snippets.

@mjau-mjau
mjau-mjau / nginx.conf
Last active May 18, 2023 07:59
X3 NGINX config
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 / web.config
Last active May 24, 2020 13:59
X3 web.config for Microsoft IIS server
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- Prevent web access to all files in the /config/ directory -->
<security>
<requestFiltering>
<hiddenSegments>
<add segment="config" />
</hiddenSegments>
@mjau-mjau
mjau-mjau / httpd.conf
Last active May 24, 2020 12:25
X3 Apache config file
# 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
@mjau-mjau
mjau-mjau / httpd.conf
Last active May 24, 2020 12:23
X3 Extended Apache config file example
# 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 / .htaccess
Last active May 24, 2020 12:09
X3 Default .htaccess file for Apache server
# ---------------------------------------------------------------------------
# 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 / .htaccess
Last active May 24, 2020 12:07
X3 .htaccess file for Apache with only required rules
# ---------------------------------------------------------------------------
# X3 REQUIRED
# Below rewrite rules are strictly required by X3 for pages to work properly.
# ---------------------------------------------------------------------------
<IfModule mod_rewrite.c>
# RewriteEngine enabled
RewriteEngine on
@mjau-mjau
mjau-mjau / lighttpd.conf
Created April 2, 2017 11:28
X3 Lighttp config
# 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/"
)
<!-- 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 March 17, 2018 15:02
PHP get primary domain
<?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 June 28, 2017 12:46
Hiawatha Server configuration for X3
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