Regex in permalink structure
-
Hi,
My WP permalink structure uses the post slug as follows: http://www.example.com/a-nice-post . I need my wordpress posts to be ALSO available from URLs like http://www.example.com/(%5B0-9%5D%5B0-9%5D%5B0-9%5D%5B0-9%5D)/a-nice-post. Example: http://www.example.com/1234/a-nice-post
I don’t want any redirects, rather additional URLs the posts can be read at. The numerical prefix does not match any category ID and there could be a lot of different numbers used for a single post. In addition, if such a numerical prefix is used in the post URL, all post links in the page should have the same prefix.
Setting:
– “[0-9][0-9][0-9][0-9]” as the permalink structure
– RewriteRule ^/?([0-9]{4})/(.*) /example/index.php?name=$2 [QSA,L] as a new rewrite ruledoes part of job, but all related links are wrong.
Any idea how I could achieve this ?
Thank you,
Tom
The topic ‘Regex in permalink structure’ is closed to new replies.