# User-friendly URIs for permanent links # by ncyoung.com and Michaelpark.net Sources: http://ncyoung.com/entry/86 http://board.michaelpark.net/viewtopic.php?t=20 Please note: This txt file will assume you don't have a separate file to view permanent links in. If you do have a b2permanent.php or similar, replace that one with index.php in the code below. This uses apache's rewrite rules from an htaccess file. Many but not all servers allow rewrite rules in .htaccess files, so that would be something to check before starting or when you run into trouble. Some GUI FTP clients hide .htaccess file(s) as soon as they're uploaded. You might want to filter the content. In WS_FTP the filter is '-la' without the single quotes. If you use another client and can't see the .htaccess file, go to the software homepage and read their FAQ. And if you haven't already created one, that could also be the reason you don't see it:p .htaccess: [code] Options +FollowSymlinks RewriteEngine on RewriteRule permaLink/([0-9]*) /index.php?p=$1&c=1&tb=1&pb=1&more=1 [/code] Then, put the following code _before_ the line callig blog.header.php: [code] [/code] That's it! The code above opens the post # by www.yourdomain.com/permaLink/# # Alternative version # I didn't want my comments (nor tb and pb) showing on my permanent entry, so Michael Park made the following adjustments. With this code I had no problem with the included b2comments.php. .htaccess: [code] Options +FollowSymlinks RewriteEngine on RewriteRule permaLink/([0-9]*) /index.php?p=$1 [/code] And the php: [code] [/code] Live example @ http://www.sigg3.net/entry/807 Trivia: URI or URL? A URI can be classified as a locator or a name or both. A Uniform Resource Locator (URL) is a URI that, in addition to identifying a resource, provides means of acting upon or obtaining a representation of the resource by describing its primary access mechanism or network "location". For example, the URL http://www.wikipedia.org/ is a URI that identifies a resource (Wikipedia's home page) and implies that a representation of that resource (such as the home page's current HTML code, as encoded characters) is obtainable via HTTP from a network host named www.wikipedia.org. Sources: http://ncyoung.com/entry/86 http://board.michaelpark.net/viewtopic.php?t=20 http://en.wikipedia.org/wiki/Uniform_Resource_Identifier