Reference: mod_rewrite, URL rewriting and “pretty links” explained

To understand what mod_rewrite does you first need to understand how a web server works. A web server responds to HTTP requests. An HTTP request at its most basic level looks like this: GET /foo/bar.html HTTP/1.1 This is the simple request of a browser to a web server requesting the URL /foo/bar.html from it. It … Read more

What are the safe characters for making URLs?

To quote section 2.3 of RFC 3986: Characters that are allowed in a URI, but do not have a reserved purpose, are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. ALPHA DIGIT “-” / “.” / “_” / “~” Note that RFC 3986 lists fewer reserved punctuation marks … Read more

How does Stack Overflow generate its SEO-friendly URLs?

Here’s how we do it. Note that there are probably more edge conditions than you realize at first glance. This is the second version, unrolled for 5x more performance (and yes, I benchmarked it). I figured I’d optimize it because this function can be called hundreds of times per page. /// <summary> /// Produces optional, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)