About

PHP passes URL parameters in the form of http://example.com/?p=123, which is the pattern that is seen in the WordPress default permalink structure for a single post page. Such URLs can become long and difficult to read and seem to be generally considered to be unattractive.

It is possible to load a file from a directory or subdirectory on a webserver by providing those directories as part of the path in the URL-- for example, http://example.com/directory/subdirectory/readme.html. URLs of that form are more easily readable and tend to be considered more attractive that URLs witht he ?p= structure, hence the term "pretty permalink" used by WordPress.

However, dynamic database driven sites typically load many different "pages" from the same file and do not have distinct paths to particular pieces of content, as in the URL above. By leveraging certain features of the web server, such as mod_rewrite on the Apache server, and carefully creating rules to control the translation of the URL structure it is possible to mimic that /directory/subdirectory URL pattern with a dynamic site.

Reference

http://codex.wordpress.org/Using_Permalinks
http://codex.wordpress.org/Class_Reference/WP_Rewrite
http://httpd.apache.org/docs/current/mod/mod_rewrite.html

history | show excerpt | excerpt history