Forum Moderators: phranque
http://www.example.com/folder/2008/03/post_and_name.html
but the system I'm moving to has urls like this:
http://www.example.com/folder/2008/03/post-and-name/
can htaccess rewrite those old urls to the new format, and if so what would the code look like? thanks in advance for any and all help with this.
[edited by: encyclo at 1:14 am (utc) on Mar. 16, 2008]
[edit reason] switched to example.com [/edit]
RedirectMatch - but before you do so, see whether your new CMS can be set up to keep the old URL structure. Redirecting should be seen as a last resort. There are some useful resources linked in the Apache forum charter [webmasterworld.com] - bear in mind that members are usually very willing to help debug code, but few are willing to write it from scratch. ;)
You can use a rewrite to connect those old-style URLs to the new-style internal filenames.
That is the best option.
Second best is to switch the URLs to the new format and redirect all the old URLs to the new URLs. That will lose some ranking for a while, and maybe some traffic too.