4 On Q Web Open Source CMS Brisbane, Australia: Simulating Static Pages with Typo3
 
On Q Web
 
Google


Simulating Static Pages with Typo3

Simulating static pages in Typo3 is really simple as all pages inside a Typo3 installation are called from the index.php file on the root of your website.

To make it work with the Apache webserver, Apache needs to have rewrite module intalled, loaded and working.

Configuring Apache

In my particular intallation of Apache there is a line in the httpd.conf that is like this:

LoadModule rewrite_module modules/mod_rewrite.so

Make sure that line is there and that is not commented out.

The next step is to verify if your particular installation allows you to override security settings by putting a .htaccess file in the root directory of your website. You can either allow that for all your virtual servers, or you can allow it only in some particular servers.

This is an example of a virtual server configuration file:

<VirtualHost xxx.xxx.xxx.xxx:80>
DocumentRoot /path/to/document/root
ServerName www.xxx.xxx
ServerAlias xxx.xxx
   <Directory "/path/to/document/root">
   AllowOverride All
   </Directory>

ErrorDocument 404 http://www.xxx.xxx
</VirtualHost>

After the virtual server (or the whole Apache) configuration has been changed, you need to restart Apache.

Now you can place an .htaccess file in the root directory of your web installation.

Something like this could work:

 

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^typo3$ typo3/index_re.php
RewriteRule ^[^/]*\.html$ index.php
RewriteRule test.html index.php

Create a plain text file, name it .htaccess, copy the lines of code that are above to it and put that file in your website root installation.

Please notice the last line:

RewriteRule   test.html index.php

I just put in there for testing purposes. You can delete it after you Know the rewite module is working.

Testing the Apache Rewrite Module

If everything went ok, you should go to your website and try the test:

http://www.your.website/test.html

After doing that, you should get redirected to index.php, if not, then something is not working in your redirection and you should not continue this tutotial until you get it right.

If after doing that you get redirected to index.php, then your redirection is working and you can delete the last line of the .htaccess file.

TypoScript Code

Put the following TypoScript code on your main template:

config.simulateStaticDocuments=1

config.simulateStaticDocuments_addTitle=30

The first line activates the Simulate Static Documents Option

The second line shows the number of digits the title can have

Save the TypoScript, clear all cache and that should do the trick.

Good Luck!

 

 

Why personalisation hasn't worked

It hasn't worked because the cost of doing it well usually significantly outweighs the benefits it delivers. [more...]

ACT set to adopt open source bill

The Australian Capital Territory is set to become the first jurisdiction in the country to adopt a bill which says that public bodies should, as far as practicable, consider the use of open source sof... [more...]

Companies buy open source because it's better, not cheaper

European enterprises are adopting open source software on the grounds of quality and flexibility, rather than merely considering it "good enough" because it is inexpensive, according to a new survey f... [more...]


 


Copyright © 2005 On Q Web, ABN 53 840 602 489. All rights reserved. Please read our privacy policy. Unsubscribe from our mailing list.