I came across an odd issue whereby some catalog URLs where being rewritten to include extra characters that shouldn’t be there. After much hair-pulling I discovered a fix. Rather than writing custom URLs try the following.
Log in to your database server. Here I am using phpMyAdmin. Navigate to the correct database, then the core_url_rewrite
table.
Create a backup of the table on the Export tab
Navigate to the Browse tab. At the bottom Check All then Delete. Check you have the correct data/table select and accept the Are You Sure? Prompt.
Close phpMyAdmin, log in to the Magento admin panel, then, navigate to System > Index Management. Check Catalog URL Rewrites select Reindex data and press Submit.
This will force repopulation of the core_url_rewrite table. If it hasn’t, you can reimport data through the backup created earlier.
Hopefully this sorts your Magento URL rewrite issues!