1. Enable module rewrite fulmanp@ubuntu:~$ sudo a2enmod rewrite [sudo] password for fulmanp: Enabling module rewrite. To activate the new configuration, you need to run: service apache2 restart fulmanp@ubuntu:~$ sudo service apache2 restart * Restarting web server apache2 2. In file sudo gedit /etc/apache2/apache2.conf add Options Indexes FollowSymLinks AllowOverride All Require all granted where Options (description from: http://httpd.apache.org/docs/2.2/mod/core.html#options) +FollowSymLinks makes Apache follow system symbolic links (shortcuts, if you would) in your file system. +Indexes allows access to open folders within your file system, e.g. if you forgot to put an index.{ext_here} file down within a directory, +Indexes would allow list that directory's contents to the user. AllowOverride All: This is telling apache, that all configurations can be overridden in the /var/www/html/fulmanp/pai/rest and all its sub-directories (recursively). Require all granted: this is new equivalent of Allow from all (no IP addresses blocked from accessing the service) 3. Restart Apache sudo service apache2 restart 4. Create file /var/www/html/fulmanp/pai/rest.htaccess with content # use mod_rewrite for pretty URL support RewriteEngine on # If a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward the request to rest.php RewriteRule . rest.php