07941 016502

SME Server: Allow .htaccess in Secondary IBays

Enable .htaccess in iBay

log on using shell (putty, etc.) with the root username and password.

login as: root

root@server's password: password

Enter the following commands:

(where: my_ibay_name is the name of the ibay we want to enable for .htaccess override)

[root@server ~] db accounts setprop my_ibay_name AllowOverride All

[root@server ~] signal-event ibay-modify my_ibay_name

Errors with mod_rewrite

When we enable .htaccess for secondary iBays, we might get access denied messages in the browser. These messages are generated by Apache and will appear if we are also using mod_rewrite rules in the .htaccess file.

Forbidden

You don't have permission to access /page on this server.

Checking the httpd/error_log in the server manager gives more detail - we'll find errors such as this:

[Mon Oct 12 15:42:17 2009] [error] [client 192.168.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/my_ibay_name/html/home

Allow FollowSymLinks

When we use mod_rewrite to implement ‘clean’ URLs for site pages, e.g. /blog rather than /blog.php, Apache must be instructed to follow symbolic links with the following command entered into the .htaccess file (above RewriteEngine On).

Options +FollowSymLinks

An example .htaccess file would look like this:

Options +FollowSymLinks

RewriteEngine On

# redirect all /whatever to /?page=whatever

RewriteRule ^([^/\.]+)/?$ /?page=$1 [L]

Related Commands

To check which properties are set for the ibay, use this command:

[root@server ~] db accounts show my_ibay_name

To delete a property, use this command:

(where: the_property is the name of the property to delete)

[root@server ~] db accounts delprop my_ibay_name the_property

E.g. to delete a property, e.g. AllowOverrid (because it is misspelt), use this command:

[root@server ~] db accounts delprop my_ibay_name AllowOverrid

Warning

Note: where .htaccess files can be uploaded by other users, consider restricting what .htaccess is permitted to override.

this worked for sme server: SME Server 7.4

More from EasyNoodle

SEN Mouse

EasyNoodle SEN Switch Mouse - Time saver for use with Special Needs Software.

 

Web Development

Need a website - look no further without speaking to us.

 

IT Support

We'll take care of all your IT support and software development needs.

 

Other Items of Interest