Archive for February, 2006

Hiding affiliate urls

Let’s say you are a webmaster into a few affiliate programs. You will have URLs which will look like;


or something like that.

The best way of getting visitors to not go directly to the site is making them believe (and the searchengines for that matter), that you are not an affiliate but that it is your site.

You do this by registering a domain and then using mod_rewrite in Apache:

Let’s say we registered and you want to rewrite, without users be able to see, this url to, you should set, in Apache;

RewriteEngine On
RewriteRule (.*)$1?id=xyz [P]

No-one will be able to see the id in the URL without using frames, iframes etc.

Apache + Webdav + LDAP + Debian

Getting those to work is not that difficult, but a LOT of site keep nagging about using:


You will get something like:

Invalid command ‘LDAP_Server’

Prerequisites are:

– Apache 2 under Debian
– Installed and working (open)LDAP

Something like; apt-get install apache2

Symbolic link the dav_load in mods-available/ to mods-enabled/. Do the same with auth_ldap.load and dav_fs.conf and dav_fs.load.

Then add the following to apache2.conf:

Listen 666
<VirtualHost *:666>
DAVLockDB /var/lib/dav/lockdb

Alias /share /home/share

<Location “/share”>
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all

AuthType Basic

AuthLDAPBindDN cn=admin,dc=mydomain,dc=com
AuthLDAPURL ldap://,dc=mydomain,dc=com?uid?sub?(objectClass=*)

AuthName “Repository Access”
Require valid-user


will be shared now under;


You can use SSL by putting:

SSLEngine On

in the <Location> directive.

I had a problem that I also use Samba and SCP for access on the same system, meaning that there could be a potential sharing access problem; everything must be written with group user and then made 770 directory/file mask.
To fix this, put in /etc/init.d/apache2

umask 0007

somewhere at the start and restart Apache. It will work..