Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ryanlid's full-sized avatar
🎯
Focusing

ryanlid ryanlid

🎯
Focusing
View GitHub Profile
@JustThomas
JustThomas / wordpress-multisite-internal-redirect-loop.md
Last active March 27, 2024 14:45
WordPress Multisite: How to fix error "too many redirects"

WordPress Multisite: How to fix error "Request exceeded the limit of 10 internal redirects"

I am running a WordPress multisite network with sub-directory setup. When I check my error.log file, it is full of entries like this one:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'Limit InternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The problem was, in my case, one specific rewrite rule in the .htaccess file.

Problem description

@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active March 25, 2024 22:48
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@ccbikai
ccbikai / m163player.php
Created July 28, 2014 06:24
WordPress快速插入网易云音乐
function wp_iframe_handler_m163( $matches, $attr, $url, $rawattr ) {
$iframe = '<iframe width="430" height="200" src="http://miantiao.jd-app.com/m163player/'. esc_attr($matches[1]) . '" allowtransparency scrolling="0" frameborder="0" ></iframe>';
return apply_filters( 'iframe_m163', $iframe, $matches, $attr, $url, $rawattr );
}
wp_embed_register_handler( 'm163_iframe', '#http://music.163.com/\#/song\?id=([\d]+)(.*?)#i', 'wp_iframe_handler_m163' );
@massar
massar / server-git.conf
Created March 6, 2014 21:14
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}
@Stanback
Stanback / nginx.conf
Last active April 22, 2024 19:23 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which