Skip to content

Instantly share code, notes, and snippets.

@RaVbaker
RaVbaker / readme.md
Created March 30, 2012 20:12
[HOWTO] Rewrite all urls to one index.php in Apache

Redirect All Requests To Index.php Using .htaccess

In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:

Simple Example

This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

@adhipg
adhipg / countries.sql
Last active February 21, 2026 11:07
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@thinkphp
thinkphp / gist:1440007
Created December 6, 2011 21:06
Breadth-First Traversal of a Binary Tree.js
/**
* Breadth-First Traversal of a Binary Tree in JS
* by Adrian Statescu <[email protected]>
* MIT Style License
*/
function Node(info){
this.info = info
this.left = null;