Skip to content
Devin Smith edited this page Dec 10, 2015 · 4 revisions

Apache Mod Rewrite

Tipsy will either read your $_SERVER['REQUEST_URI'], or a $_REQUEST['__url'] variable. In order to tell Apache to forward all pages to your index file, create a .htaccess file. Note that the ?__url=$1 is optional.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME}		!-f
RewriteCond %{REQUEST_FILENAME}		!-d
RewriteRule ^(.*)					index.php?__url=$1 [L,QSA]

Nginx

You will need an nginx config file that looks something like this

location / {
    try_files $uri @rewriteapp;
}
location @rewriteapp {
    rewrite ^(.*)$ /index.php last;
}

PHP Short Tags

If you are using templates, I highly recommend enabling PHP short tags. It will save you lots of time when working with variables. For more information, see PHTML View Templates.

To enable short tags, add the following line to your php.ini

short_open_tag = On

Or you can add it using an Apache .htaccess

php_value short_open_tag On