Forum Moderators: phranque
I am in final stage of releasing a new version of my website. I have more than 20.000 pages that I must modify the url for.
It is possible for me to make 301 redirects for each of those links? here is an example: as now, my urls are like this: www.example.com/article456.html and after I finish the project, the urls will have this form: www.example.com/title-of-the-article-456.html
do I have to create a 301 redirect in .htaccess for each page?
thank you for your time.
mihai.
I suggest finding a php or other scripting language solution, so you can make a database connection and easily manipulate and insert the title to direct visitors to the new page.
You can use Mod_Rewrite to serve the information from the dynamic page you create for the redirects to all of the old URLs requested and assuming you have a pattern to match similar to your example this should be able to be accomplished using 1 to 'a limited number' of rules, which will depend on the pattern(s) present in the exact URLs you need to match and redirect.
Another factor is the extent to which it may be possible to prevent the redirect code from executing when it is not needed for a particular request; If the old URLs all share some common factor, it may be possible to 'skip' all or most of them when 'new' URLs are requested, thus mitigating the performance impact. So, if all of your old URLs are "/article-<number>.html", then you could make a rule at the very top to detect "/article-<nothing-here><number>", and skip the remaining rules if it matches. Having done that, you server performance over time would be determined by how fast you can get the majority of your inbound links updated to point only to the new URLs.
Jim