cloudengine / .htaccess

Full commit
# Apache/PHP/CloudEngine settings.

# Protect files and directories.
<FilesMatch "\.(.*sql|orig)$|^\.(hg|git)">
    Order allow,deny

# Don't show directory listings. Follow symbolic links.
Options -Indexes
Options +FollowSymLinks

# Set the default handler.
DirectoryIndex index.php

# Error message for non-existent favicon. (Apache 1.3, no end quote.)
<Files favicon.ico>
    ErrorDocument 404 "The requested file favicon.ico was not found.

<IfModule mod_rewrite.c>
    RewriteEngine on

    # Restrict your site to one domain.
    #RewriteCond %{HTTP_HOST} !^example\.org$
    #RewriteRule ^(.*)$$1 [L]

    # Legacy paths.
    RewriteRule user/(login|logout|register)    auth/$1  [QSA,L]
    RewriteRule user/(activation/.*)            auth/$1  [QSA,L]
    RewriteRule user/(forgotten_password|change_password) auth/$1 [QSA,L]
    RewriteRule user/(forgotten_password_reset) auth/$1  [QSA,L]

    RewriteRule news/view/(.*) blog/view/$1 [QSA,L]

    # Suggestions API - ?term=X
    RewriteRule api/suggest/users(.*)  message/get_message_recipients [QSA,L]
    # Protect scripts.
    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteRule (.*)\.php$ index.php/$1  [L]

    # Protect hidden files.
    RewriteRule ^\.(hg|git).*$ index.php/_403_ [QSA,L]

    # Finally, point to the front controller.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]

<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php