I'm a little surprised, however, that we haven't yet explored another fairly common alternative.
If you have 200 or more pages in the root that need to be redirected, I think it makes sense to start looking for ways that won't create a large .htaccess file. If they're not in the root, however, I think it makes even more sense to take advantage of the fact that .htaccess is a directory-level option.
You're not stuck with just the one sitting in your root, after all.
If you have 200 or more pages in the root that need to be redirected, I think it makes sense to start looking for ways that won't create a large .htaccess file. If they're not in the root, however, I think it makes even more sense to take advantage of the fact that .htaccess is a directory-level option.
You're not stuck with just the one sitting in your root, after all.
Thanks for point out this alternative. In my case, the old pages are in a subdirectory. I intially attempted to use the .htaccess in the subdirectory and got caught in a loop because of a syntax problem. It is amazing that there is so much wrong information about how to do this. I found several sites state flat out that you cannot or should not use .htaccess in subdirectories. I gave up on it too soon.
After you made this suggestion, I figure out why it didn't work for me intially. I didn't realize that I needed to include the subdirectory path in the redirect statement. My old pages were all in a /products/ subdirecty. I incorrectly assumed that the redirect statement in the sub level .htaccess should be:
CODE
Redirect 301 /oldfile.html http://www.mysite.com/newfile.php
That didn't work and I gave up after reading some wrong info. I later found out that I needed to include the subdirecty in my old file path statement. I should have used /products/oldfile.html
In my specific case, I'm still happy with the php parse method. I only have one or two real html pages that rarely get called. All of the other html pages are just redirects. But I can see how the .htaccess method might be a better way to go depending on the specific application.
Thanks again to everyone for help and suggestions.






This topic is locked



