Redirect example.com to www.example.com with TYPO3



 

301 redirects from URI's like example.com to www.example.com can be done easily without editing an .htaccess file when you're web site is based on TYPO3.

Introduction

You probably know that for the sake of your search engine rankings, you should choose to either have your web site use an address like 'www.netdip.com' or like 'netdip.com' - but you shouldn't have it both ways. 

You might already know that you can edit your .htaccess file on your server to make the NON-www domain automatically redirect to the proper WWW domain - or just the opposite.

With TYPO3, you don't need to edit .htaccess. You can configure TYPO3 to do this with domain records.

I've decided recently to let TYPO3 handle my domain redirection for a couple of reasons:

  1. For simplicity I like to manage everything possible regarding my TYPO3 driven site within TYPO3. I like that domain records and redirection instructions can be stored in my TYPO3 database with almost everything else regarding the proper functioning of this site. I don't like to have too much stuff in my .htaccess file, it can get messy and too difficult to manage.
  2. By adding a simple 301 redirect instruction in my .htaccess file, it modifies all pages on the netdip.com domain whether or not those pages are TYPO3 driven. I forsee myself writing some non-TYPO3 applications on this domain for which I might like a shorter url without the 'www' in the beginning. By creating the 301 redirect within TYPO3, I only modify the behavior of TYPO3, and not any little static page I may have lying around on this domain.

So, what follows is all that has to be done to redect an address like netdip.com/typo3-cms/ to http://www.netdip.com/typo3-cms/.


No comments

Add comment

* - required field

*

CAPTCHA image for SPAM prevention
If you can't read the word, click here.
*
*
TYPO3 CMS Computers & Technology
 

Netdip.com is an excellent web site that's powered by TYPO3 and other great open source software. Netdip.com is also a fat free alternative to ice cream.