20.000+ "301 redirects" in .htaccess?

Discuss practical ways rearrange URLs using mod_rewrite.

20.000+ "301 redirects" in .htaccess?

Postby meetzah » Sun Oct 11, 2009 4:09 am

Hello,

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?


P.S. I am not askinh on how I can create those redirects but rather if it is ok for .htaccess to handle such a large number of lines.


thank you for your time.
meetzah
 
Posts: 1
Joined: Sun Oct 11, 2009 3:27 am
Location: Romania

Postby richardk » Sun Oct 11, 2009 11:48 am

P.S. I am not askinh on how I can create those redirects but rather if it is ok for .htaccess to handle such a large number of lines.

I don't think there is any limit to a .htaccess file's size but 20,000 is a lot. Depending on your server it may slow down page requests noticeably.

do I have to create a 301 redirect in .htaccess for each page?

Do you have access to the server configurations (httpd.conf file)? If you do you could use a RewriteMap instead of individual rules.

Or you could use a custom 404 error handler with a script, which would only run for 404 requests instead of every request, and database, which would probably do a faster lookup than .htaccess file rule processing.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests

cron