Buldre -
Hi,
A website with many internal links has unfortunately linked with the relative part of the SEO-friendly URL, instead of with the Joomla internal link structure. I now want to correct the links to Joomla's link structure. Fortunately, the relative portion of the SEO-friendly links includes both category names and article numbers, so I have something to grab onto. I want the structure to change as follows.
From:
<a href="category1/3500-some-old-stuff.html">Some old stuff</a></p>
To:
<a href="index.php?option=com_content&view=article&id=3500&catid=1">Some old stuff</a></p>
From:
<a href="category2/3501-my-new-content-article">My new content article</a></p>
To:
<a href="index.php?option=com_content&view=article&id=3501&catid=2">My new content article</a></p>
And so on. I don't know much about regular expressions, but have tried the following search:
<a href="category2/(.*?)-([\a-zA-Z0-9]+)[\>]
And replacement:
<a href="index.php?option=com_content&view=article&id=\1&catid=2">
This seems to work fine for most of the links, but fails for approximately 20 percent of them, where the link text is also removed. The most likely explanation is that my codes are wrong. So instead of this result:
<a href="cat2/3501-my-new-content-article"><a href="index.php?option=com_content&view=article&id=3501&catid=2">
My new article content</a></p>
I end up with this:
<a href="cat2/3501-my-new-content-article">My new content article</a> </p><a href="index.php?option=com_content&view=article&id=3501&catid=2">
Which terms can I use for search and replacement to achieve the desired result?