map-location-dotPretty URL's

You can modify the .htaccess file on your server to ensure the CMS produces clean, pretty URL's.

We'll have detailed instructions on how to configure your .htaccess file soon. In the meantime, you can add the following code to your htaccess file:

RewriteEngine On

# ----------------------------------------
# 1. Redirect /post/?item=slug and /post/index.php?item=slug → /post/slug
RewriteCond %{THE_REQUEST} \s/post/(index\.php)?\?item=([^&\s]+) [NC]
RewriteRule ^post/?$ /post/%2? [R=301,L]

# ----------------------------------------
# 2. Internally rewrite /post/slug → /post/index.php?item=slug
RewriteRule ^post/([^/]+)/?$ post/index.php?item=$1 [L,QSA]

You will then need to add the following “base” tag to the <head> area of your project’s template:

<base href="/">

<!-- OR if you're publishing to a subfolder: -->
<base href="/subfolder/">

This ensures that URL like /post/my-first-post is rewritten under the hood to /post/index.php?item=my-first-post.

Obviously “post” can be anything you want, you just need to ensure your update the htaccess code to match whatever you’ve called the folder in Elements.

Last updated

Was this helpful?