I have a Wordpress website which contains the following URL pattern:
http://www.somewebsite.com/2017/01/30/sample-post/
With the help of user w3dk, I have been able to permanent redirect it to:
http://www.somewebsite.com/sample-post/
using
RewriteEngine On
RewriteRule ^\d{4}/\d\d/\d\d/(.+) /$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
and kept the Permalink Settings in Wordpress as Post Name.
So far so good.
Now some newer posts on the website use a custom post type “items” bearing the url format:
http://www.somewebsite.com/items/sample-post/
Notice "items" in the url. For consistency, I now want to make my old urls of the same format so that the older urls use the custom post types "items".
Do I write another rewrite rule that now changes
http://www.somewebsite.com/sample-post/
to
http://www.somewebsite.com/items/sample-post/
If yes, how?