Dynamic URL generates dynamic content

I would actually tackle it with the .htaccess file, using RewriteCond and RewriteRule, something like:

RewriteCond %{REQUEST_URI} ^/advice-on-(\[a-zA-z])$
RewriteRule ^/?(.*) http://domain.com/customadvice?advice=$1 [L]

Note that the Regex in the parenthesis will be reused as $1 in the RewriteRule.

You should then have a WordPress page on /customadvice and use the $_GET attribute from the page template for whatever use you need.

The path /advice-on should still give a 404.

Leave a Comment