AdminCP > System Settings > Search Engine Optimization > Friendly URL Features
Set YES to Redirect to new friendly URL format and Redirect to new friendly URL format
Now create a file called .htaccess with the following contents:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
and insert it in the forum path.