Create WordPress Permalinks

Permalink is a portmanteau of the words permanent and link. Permalinks are URLs that are automatically created for specific posts or pages in WordPress so that you or others can link to them. WordPress’s default settings assign post numbers as permalinks, meaning a link to a specific post would look like example.com/?p=42. To enforce a “prettier” permalink format, you need to make a few adjustments to Apache or nginx.

For more information on permalinks, visit the WordPress guide on permalinks.

To configure permalink settings:

  1. Log in to the WordPress admin panel through the site’s /wp-admin URL.
  2. Mouseover Settings in the menu on the left of the screen, then click Permalinks:Wordpress Settings Permalinks
  3. Select a preferred permalink style or create your own Custom Structure and click Save Changes
  4. Configure the web server to allow WordPress to create the customized URLs using the appropriate section below.

Instruct Apache to allow individual sites to update the .htaccess file, by adding the following options to the Directory section in the virtual host configuration:File: /etc/apache2/sites-available/example.com

<Directory /var/www/html/example.com/public_html>
Options Indexes FollowSymLinks 
AllowOverride All 
Require all granted 
</Directory>

Reload Apache to enable the changes:

sudo systemctl reload apache2
What are your feelings
Updated on December 11, 2023