Welcome to WebmasterWorld Guest from 54.211.136.250

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Could htaccess help me with this?

   
12:44 am on Mar 16, 2008 (gmt 0)

10+ Year Member



I'm moving from one CMS to another and they generate different url patterns. Right now my urls look like this:

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]

1:13 am on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You can redirect the URLs with mod_rewrite or
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. ;)

2:16 am on Mar 16, 2008 (gmt 0)

10+ Year Member



Thanks much.
6:00 pm on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



If you can keep the old-style URLs in your internal links, the search engines will have no idea that anything has changed on the site.

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.