Best practice would always be to serve websites from the public folder on your server, although If this is not possible and you need to serve your website from a folder underneath the public directory, the following can be done to allow this.


Edit the .htaccess file under the public folder of the site and add the following at the top:


RewriteEngine on
RewriteCond %{REQUEST_URI} !path/to/subfolder/
RewriteRule (.*) /path/to/subfolder/$1 [L]


So for example, if your site files are under a folder named "wordpress", you would add the following:

RewriteEngine on
RewriteCond %{REQUEST_URI} !wordpress/
RewriteRule (.*) /wordpress/$1 [L]