Forum Moderators: phranque
Well, for best portability, I'd recommend you type the directives exactly as they appear in the Apache mod_alias documentation, but otherwise they're correct.
Redirect 301 /the_old_page.htm http://example.com/the-new-page.htm
Redirect 301 /the_old_page2.htm http://example.com/the-new-page2.htm
Redirect 301 /the_old_page3.htm http://example.com/the-new-page3.htm
Now, I mentioned that you may not need 50 rules. Here's an example, treating your example urls as if they were literally the real urls:
RedirectMatch 301 ^/the_old_([^.]+)\.htm$ http://example.com/the-new-$1.htm
That will redirect *all* urls of the form "/the_old_<something>.htm" to "/the-new-<something>.htm" with only one directive instead of fifty.
If your old urls have such commonality, you can take advantage of it to reduce the number of redirect directives you need to write, test, and maintain.
Jim
^(www\.)?example\.com if you do want those redirected. In fact, the condition is probably not needed at all. ^folder/(1[a-z])\.htm$ is it. I'm under the impression I can't use a wildcard redirect because there are other pages in the originating folder that are either not be redirected/moved or are already redirected to example3.com
RedirectMatch 301 ^/1([^.]+)\.htm$ http://example.com/1$1.htm
is that right?
Would need to put Rewrite engine on above that in my htaccess?
And would this go in the main htaccess in the old site root folder or in an htaccess file in the old folder where the old pages reside now?
Or am I totally confused?
The not-to-be-redirected pages are a bigger problem. Is there any kind of pattern to the naming? Are there anything like 26 pages staying behind, or only a few?
If "1a" and "1z"
Pages that have already been redirected are not a problem, because, well, they have already been redirected. So if their rule comes first,
go from most specific to most general. For example, individual page redirects go before index.html redirects which in turn go before the final with/without www. redirect.