TYPO3: 301 redirect pages or tt_news records
I’m getting a lot of traffic lately of people searching for a tutorial on 301 redirects, especially in combination with tt_news. Therefore I’m going to explain how to make such a redirect the easiest way. In this tutorial I’m assuming you already have a website up and running with RealURL installed and you want to setup a 301 redirect for a page or news record which no longer exist.
Note: If you don't know anything about a 301 redirect please read the grey box at the bottom of the article!
Redirecting a page using 301
In this tutorial we have 2 pages: a news list page and a news single page
http://www.your-website.com/old-news-page/ http://www.your-website.com/news/
Now, since both page 1 and 2 are well indexed in Google and there are several inbound links we don’t want to delete either of them. Yet the first news item had become obsolete and we want to redirect all these inbound links to another page.
If we delete the first page the visitor will end up with a 404 page. A 301 redirect could redirect the first pages to another page, and this is Google friendly too! So… how to do this?
1. In the backend, go the 'info' module in the left main menu. 2. Select the rootpage of your website. 3. Choose "Speaking Url Management" from the dropdown menu. 4. Choose "Error log" from the second dropdown menu.
You should now see a list of url errors:
It seems the page ‘old-news-page’ has been requested by a visitor but could not be found. To make sure this won’t happen again we are going to redirect this page to our new page: ‘news’. As you can see, there’s a little button called ‘set as redirect’. Click this button to set the redirect for this url. You should now see the following screen:
In the screenshot above I’m redirecting the page ‘old-news-page’ to the new page: ‘news’. As you can see I activate the ‘Send “301 Moved permanently” header’ checkbox. Now TYPO3 will make the redirect a 301 redirect!
1. Set the old url (this way it's set automatically) 2. Set the new page 3. Save the redirect 4. Go to http://www.your-website.com/old-news-page/ 5. TYPO3 will redirect you to http://www.your-website.com/news/ 6. Redirect succesful!
Now let’s see how we can make this work for tt_news!
Redirecting a tt_news record using 301
When you delete a news record and try to visit it you’ll end up with a ‘no news id’ error. The RealURL Management Error Log does not register this error! So, we need to manually set the redirect.
In this case we have 2 news records:
http://dev.emaux.nl/news/news-single/article/example-news-record/ http://dev.emaux.nl/news/news-single/article/new-news-record/
To redirect news record 1 to news record 2, please follow the following steps:
1. In the backend, go the 'info' module again. 2. Select the rootpage of your website. 3. Choose "Speaking Url Management" from the dropdown menu. 4. Choose "Redirects" from the second dropdown menu. We're back at the second screenshot above! 5. Click '+ New entry' 6. Set the url which no longer exists 7. Set the new url to which you want to redirect 8. Check the 301 checkbox 9. Save and enjoy!
That’s it, your done! Repeat this procedure for all news items you delete. Hope this tutorial was clear and helpful. If you have any questions don’t hesitate to ask.
What is a 301 redirect?
A 301 redirect is a redirect which uses a 301 http-header code. This code tells search engines the page is no longer available at the given location but is 'permanently moved' to another location. The resource (e.g. search engine) should use the new URL in the future instead of the old URL. In real life this would mean the old page should be replaced by the new page upon re-indexing. This is a good thing! Now the search enige realizes the old page doesn't contain the information which is being looked for. The new page does, so your pageranking is preserved. A win-win situation: We happy (pageranking preserved), seach engine happy (page contains good information) and visitor happy (finds the information it's looking for).




As Dmitry Dulepov explains under “Why are TYPO3 redirects bad?” on http://dmitry-dulepov.com/article/redirects-typo3-and-realurl-vs-mod-rewrite.html that it’s much better to redirect in the Apache configuration or the .htaccess file.
Of cource, the bigger the site the more it’s important.
Dmitry’s approach is the best way when it comes to speed but it also is much less fault tolerant. Other that that you would need to know the basics of .htaccess. I suggest the .htaccess redirects only to people who know what they’re doing and test their lines on a dev-server before setting them live! Another example of Dmitry’s approach can be found here: http://www.typo3-addict.com/2009/01/changing-domainname-using-301-moved-permanently/
Thanks, I am using Dmitry’s method now, for example the page “hoeveel” has become “hoeveel-heb-ik-nodig”.
Add this in .htaccess :
RewriteCond %{REQUEST_URI} ^/hoeveel/$
RewriteRule .* /hoeveel-heb-ik-nodig/ [L,R=301]
RewriteCond %{REQUEST_URI} ^/hoeveel$
RewriteRule .* /hoeveel-heb-ik-nodig/ [L,R=301]
Because in Google and other sites links are not allways ended with a / I do both:
hoeveel/
hoeveel
gRTz jacco
[...] found this from Google, very useful for typo3 users Typo3 301 Redirections TYPO3: 301 redirect pages or tt_news records Reply With Quote [...]