20100508 flatpress prettyurls - plembo/onemoretech GitHub Wiki

title: Flatpress prettyurls link: https://onemoretech.wordpress.com/2010/05/08/flatpress-prettyurls/ author: lembobro description: post_id: 162 created: 2010/05/08 23:23:32 created_gmt: 2010/05/08 23:23:32 comment_status: open post_name: flatpress-prettyurls status: publish post_type: post

Flatpress prettyurls

Now that I’ve remade this site with Flatpress, I’ve learned a great deal more about how the software works. One really useful feature that it comes with is the prettyurls plugin, which displays nicely formatted permalinks for entries in the standard /yyyy/mm/dd/article-title-here/ format. This should prove helpful for those who previously linked to the Wordpress version of this site (although not completely, since I had the bad habit of massaging link text arbitrarily). The plugin makes extensive use of Apache’s mod_rewrite to work its magic, and requires that your host’s httpd.conf enables

AllowOverride Options FileInfo

at a minimum.

The module configuration generates an .htaccess file that should work for most sites. For example, here is what’s currently in place for this site:

`

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

`

For other sites, like those that are located under the root directory, the following should work:

`

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /onemoretech/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /onemoretech/index.php [L]
</IfModule>

`

I found the procedure that worked best for me was to first enable the plugin, manually create the .htaccess file at the root of my blog directory, and finally to purge the theme and templates caches before trying to access the blog home.

Copyright 2004-2019 Phil Lembo

⚠️ **GitHub.com Fallback** ⚠️