Blog LiteUser Manual Visit Blog Lite →
Advanced and help

Pretty URLs (clean addresses)

Turn on clean, SEO-friendly addresses like /post/my-title in Blog Lite 2. Setup for Apache with mod_rewrite and for Nginx, plus troubleshooting.

By default, Blog Lite 2 works on every server with addresses like yoursite.com/index.php?route=post/my-title. Pretty URLs turn them into yoursite.com/post/my-title, which are easier to read, share and remember.

PageDefault addressPretty address
Articleindex.php?route=post/my-title/post/my-title
Categoryindex.php?route=category/travel/category/travel
Tagindex.php?route=tag/recipes/tag/recipes
Contactindex.php?route=contact/contact

On Apache

The included .htaccess file already contains the rewrite rules. You only need:

  1. Apache with mod_rewrite enabled (standard on almost all hosting).
  2. AllowOverride All for your folder, so .htaccess is read. On shared hosting this is normally already set.
  3. Go to Settings → General, switch Pretty URLs on and save.
  4. Open your blog and click a post to test it.

On Nginx

Nginx ignores .htaccess, so add this to your server configuration (adjust paths if the blog is in a subfolder):

location / {
    try_files $uri $uri/ /index.php?route=$uri&$args;
}

# keep private folders private
location ~ ^/(data|app|admin/views)/ { deny all; }
location ~* ^/uploads/.*\.php$ { deny all; }

Reload Nginx, then switch Pretty URLs on in the settings. Make sure your location ~ \.php$ block for PHP-FPM is also in place.

If the public pages show "not found"

Do not panic

The admin panel does not use pretty URLs, so you can always log in at yoursite.com/admin/ and switch the option off again.

  • Check that mod_rewrite is on and the .htaccess file was uploaded (some FTP programs hide files starting with a dot).
  • Ask your host to enable AllowOverride All.
  • Test on Nginx: confirm the try_files line is inside the right server block.

Other things to know

  • The addresses of your RSS feed and sitemap change too. See RSS feed and sitemap.
  • If you change this option on a live blog, update the sitemap in Google Search Console.
  • The address of an article is created from its title when you first save it. You can edit it in the post editor. See Writing posts.

Last updated