Posted by CANbike on Tue, 15 Jul 2014

[Oxwall] .htaccess and Non-Oxwall Directories and Files

Oxwall, by default, does not like external directories and files. Any attempt to access a non-Oxwall URL results in a 404 Not Found error.

Fortunately this is all controlled by the .htaccess file.

Options +FollowSymLinks
RewriteEngine On

AddEncoding gzip .gz
AddEncoding gzip .gzip
<FilesMatch "\.(js.gz|js.gzip)$">
  ForceType text/javascript
<FilesMatch "\.(css.gz|css.gzip)$">
  ForceType text/css

RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/e500\.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

Adding Exceptions

Exceptions are easy to add by including a RewriteCond before the last line

RewriteRule (.*) index.php

For example, Oxwall is installed at the domain To make an exception, add the following code to the .htaccess file:


RewriteCond %{HTTP_HOST} !$


RewriteCond %{REQUEST_URI} !/folder/


RewriteCond %{REQUEST_URI} !/file.html

Oxwall htaccess-Exceptions for Directiories Files Subdomains-thumb.png

URL “Username” Redirect

For vanity reasons, should redirect to my user profile Moreover, it should be case insensitive.

To do that, the following was added to the end of the .htaccess file:

RewriteCond %{REQUEST_URI} ^/canbike [NC]
RewriteRule (.*)

Related Item(s):