.htaccess

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

This is going to sound pretty crazy but here it goes...

I need to 301 redirect 1500 pages Sad . I am taking on a huge project, and all the pages on the site are not organized at all. There are no directories inside public_html, just 1500 HTML pages. I am going to integrate all the old pages into a CMS and I want to redirect the old pages to the new, search engine friendly URLs. So what's the limit on how many URLs you can redirect in an .htaccess file? Is there a way to add that htaccess code to the actual page? I would use a PHP redirect like

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>
'
but the pages are .html and .htm.

Any ideas?

He has: 1,758 posts

Joined: Jul 2002

You could use an apache rewrite rule to parse php in your html pages. It's quite easy and can be done with a .htaccess :

Just add the following to the htaccess:

RemoveHandler .html .htm
AddType application/x-httpd-php .html .htm
'

Andy

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

Genius! Thank you so much Andy! Laughing out loud

He has: 1,758 posts

Joined: Jul 2002

No problem... Glad I could help Laughing out loud

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.