Welcome to WebmasterWorld Guest from

Forum Moderators: ergophobe

Message Too Old, No Replies

Old page use underscores, but CMS only supports hyphens

Will a 301 redirect handle this?

10:02 am on May 13, 2014 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 24, 2001
votes: 3

I want to preserve an old page on a site (long deleted) for link value, but the filename uses underscores. The page can be re-created but only with hyphens (underscores are not supported in the CMS). Will a 301 redirect solve this or not?
7:31 pm on May 13, 2014 (gmt 0)

Senior Member from US 

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

joined:Apr 9, 2011
votes: 586

Yes, a redirect can be done for any URL. Since it's just one page, spell out the complete old name on the "pattern" side of the redirect, and the complete new name on the "target" side.

You don't identify your CMS, but if it's any of the big names, it relies heavily on mod_rewrite. So your new redirect needs to go in htaccess before the built-in RewriteRules.
7:11 pm on May 15, 2014 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
votes: 245

This might be a better job for a rewrite rather than a redirect.

A rewrite will mean the URL looks the same in the user's address bar as it always did. Since your CMS is probably using rewrites already as Lucy said, you just add one.

Let's say your page is


The CMS will let you create

But in an case, it's rewriting this to


So you could

redirect my-great-page to my_great_page

then rewrite my_great_page to index.php/p=my-great-page

That shouldn't cause an infinite loop. The key question is whether you can control the output of the link to that page. If your CMS is going to force you to show links with underscores, you could have a duplicate content problem. But if you can manually create the link, the above should work and still preserve the original URL.