Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have just converted a website to WordPress. The old site has hundreds of hard-coded html files, and the new site does not match the old site's directory structure or file naming system (bad SEO in the original site), so I can't place any "blanket" 301 redirects. Its been at least 2 months, and the old links are still appearing in Google searches, despite a google-friendly sitemap.xml.

Do I need to hardcode a 301 for every individual page in my htaccess file, or am I just misunderstanding 301s and apache? Is there some other way I can update Google about the fact that my entire site structure has changed?

share|improve this question
add comment

5 Answers 5

Based on the information you provided I'd say it doesn't look like there is an easy way for you to easily do a bulk 301 redirect, either programmatically or with a blanket .htaccess rule. It looks like you will need to manually do one for each page you migrated over to the new site.

Each page will need it's own 301 as you will want to make sure every link for each page is properly redirected to its new page. Otherwise every page on your new site will be considered new and start from scratch with PR, etc. If you had a lot of incoming links it may be a hassle to do but is very well worth it.

share|improve this answer
add comment

If there are any patterns at all to the redirects then you can cut down on the number of redirects in the htaccess file.

Failing that, you could instead rewrite all the *.html files to a PHP script that reads the redirects from a file or database, for example. You'd still need to manually input everything into said file or database, but you would cut down the size of the htaccess.

share|improve this answer
    
Ooo, I hadn't even considered the size of the htaccess file -- is that a big issue? –  Amanda Dec 6 '10 at 15:39
    
It can be a bit of a performance hit if you have over 100 (at a guess) separate rules, because the server has to check each one every time a URL is requested. If you are able to move them to Apache's httpd.conf (unlikely if you don't have a dedicated server) then that will make a big improvement. Otherwise, directing to another script would probably be the best. –  DisgruntledGoat Dec 6 '10 at 17:19
add comment

Google search with the string site:mysite.com to get a full dump of all the URLs that are indexed, or go ahead and use Google's Webmaster's Tools and get a list of 404's from them. Then, yes, you will need to manually construct a 301 redirect list.

You can import a file into WordPress › Redirection « WordPress Plugins to generate redirections and log them, too.

share|improve this answer
    
Site:mysite.com on Google is extremely unreliable. Instead, use Yahoo! Site Explorer. The only Yahoo product worth using. –  Stephan Muller Dec 6 '10 at 14:56
    
I'm not talking about Yahoo and the question isn't about Yahoo; it's about Google indexing. –  songdogtech Dec 6 '10 at 15:35
    
I know, but site:mysite.com does NOT show all the pages google has indexed. By using Yahoo site explorer you get a way more reliable idea of which pages have been crawled and indexed in general. Only setting up redirects for the pages in site: on Google is a ticket to missing out on a lot of redirects. –  Stephan Muller Dec 6 '10 at 16:12
    
You're confusing the URLs that happen to be indexed by different search indexes with how 301 .htaccess redirects or plugin-administered redirects work. Any 301 redirect will work for all web traffic, not just selected traffic from one search index or search results. Makes absolutely no difference what search index the URLs are in; 301 redirects will handle them at the site level. –  songdogtech Dec 6 '10 at 19:03
add comment

I'd say look for some pattern you can use to get close, for example match the title tags, or if the directory structure includes a category IE example.com/category/product.html then set patter to redirect all URLs with "category" to the new category page. It's certainly not as good as redirecting them to the appropriate product page, but it's better then just leaving them all as 404s. There's almost always some kind of convention even if it's a poorly thought out one. (Also assuming you still have all the files you can run Xenu Link Sleuth on them to make sure you get all the pages, even if Google has removed them from the index for being a 404, you'll want to redirect them as there may be some links pointing to them).

Good Luck.

share|improve this answer
add comment

I suggest you another plugin for wordpress, that i use on two sites administered by me, EggPlants 301 redirects. This plugin don't fill the .htaccess file with new rules, but use the internal routing system of wordpress. With this you can import the redirect rules by a cvs file, getted from the google webmaster tool and editet to include the new path.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.