Table of Contents

HTACCESS

.htaccess files provide a way to make configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. Read Apache HTTP Server Tutorial: .htaccess files for more information about .htaccess and it's directives.

In SkaDate software .htaccess files contain directives required for the software to operate correctly and securely after installation. Primary .htaccess is mainly responsible for declaring required directives. Secondary .htaccess files are mainly responsible for managing directory access.

Default directives

Primary .htaccess file of SkaDate software:

 
Options +FollowSymLinks
RewriteEngine On

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


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} !/captcha\.php
#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

Secondary .htaccess file directives vary. Most common:

deny from all

/ow_userfiles/ direcory .htaccess:

Options All -Indexes
<IfModule php5_module>
php_flag engine off
</IfModule>

Where to find .htaccess

Primary .htaccess file of SkaDate software is located in website's root directory. Same location is used to store other software related files such as ow_version.xml and index.php. Secondary .htaccess files are located within each folder of SkaDate software. Ex: ow_includes, ow_plugins.

.htaccess files can be opened from cPanel's File Manager or FTP client ( ex. FileZilla).

To open .htaccess from FTP client:

To open .htaccess from File Manager:

If you are not sure how to use FTP client or File Manager, please refer to hosting provider's documentation.

How to show hidden files in File Manager

Depending on your cPanel's interface check “Show hidden files” box:

If you are not sure how to display hidden files within your cPanel, please refer to hosting provider's documentation.

Common error code: 404 not found.

404 not found sitewide

404 not found for external pages/directories

404 not found for temporary site URL

Note: Make sure that temporary URL is used in ow_includes/config.php file.

How to edit primary .htaccess ( examples)

Adding new rewrite base

New rewrite base can be added after following line: RewriteEngine On. Ex:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /~cpanelusername 

AddEncoding gzip .gz
AddEncoding gzip .gzip

Adding new rewrite condition

New rewrite conditions must be added after following line: RewriteCond %{REQUEST_URI} !^/index\.php .

For custom external documents: RewriteCond %{REQUEST_URI} !^/document_name\.document_extension. Ex:

 RewriteCond %{REQUEST_URI} !^/sitemap\.xml 
RewriteCond %{REQUEST_URI} !^/landing-page\.html

For custom external directories: RewriteCond %{REQUEST_URI} !/directory-name/ . Ex:

 RewriteCond %{REQUEST_URI} !/banners/ 

Adding PHP handlers

Handlers can be added at the end of the default .htaccess directives. Ex:

 # Use PHP5.5 as default
        AddHandler application/x-httpd-php55 .php

Comments in .htaccess

To comment out ( hide) certain directive add # at the beginning of the line. Ex:

 #RewriteCond %{REQUEST_URI} !/captcha\.php 

.htaccess Tutorials

Rewrite Condition for Google's verification file

Click here to open tutorial.