Choosing your installation directory is very important. You want someone who is coming to your site (e.g. http://www.RosinaBignall.com/ ) to see your main page in Typo3, but you also want to be able to have other non-Typo3 pages. You may even want to run other applications alongside your Typo3 installation (such as GoTryThis which I use a lot).
So, install Typo3 in a subdirectory. I install mine in a directory called site, so the real URL to my Typo3 pages is http://www.RosinaBignall.com/site/ . With your installation in a sub-directory, you will be able to have other non-Typo3 pages and other applications on the same server. From here on out, I will assume that the installation is in the site directory. If yours is some place else, make the appropriate changes to the directions.
Next, you want to make it so that someone who goes to your site gets to your Typo3 pages. This is accomplished by editing your .htaccess file. In your site directory is a file called _.htaccess – rename it to .htaccess . That is all you need to do with this file. Now, if you go to http://www.RosinaBignall.com/site/ (for example) you should see your main Typo3 page.
Now for the real trick… getting http://www.RosinaBignall.com/ to also bring up your Typo3 pages. Here’s the trick I use. In the root of your website, create another file named .htaccess. In that file, place the following:
Options -Indexes
RewriteEngineOn
# If the file or directory does not exist, then go to Typo3
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule ^([^.]+)\.s?html$ /site/$1 [L,R=301]
# Additional redirection for subdirectories/files/ which are not found.
ErrorDocument 404 /site/index.php
# If they try to access a forbidden area (such as an Index),
# send to Typo3 main page
ErrorDocument 403 /site/index.php
By not allowing Indexes (which is a good idea regardless) with the Options -Indexes line, that forces anything that would be a directory listing to get a 403 error code (Forbidden). The last line says that all 403 errors should be redirected to your main Typo3 page. The Error…404 line says that any non existing page also get sent to the main Typo3 page. The RewriteCond and RewriteRule lines say that if the file or directory does not exist then send it to the Typo3 main page. So, you can see that this will catch any non-existing files and directories as well as any existing directories with no index files and redirect them to your Typo3 installation.
Try it out! When you go to http://RosinaBignall.com or http://www.RosinaBignall.com/ or http://RosinaBignall.com/site , you should get the same page as if you go to http://www.RosinaBignall.com/site/ . Likewise, if you go to some non-existing file or sub-directory, such as http://RosinaBignall.com/nonexistingdir or http://RosinaBignall.com/nonexistingfile.html , you should also get the same page.
Future work: I’d like to have my non-existing pages go to my Typo3 installation, but explain that the file or directory did not exist, not just bring up the homepage.