Fork me on GitHub


Deploy to a sub-directory

If you plan to deploy the application in a sub-directory of a Web server, such as instead of the root of the server as, you may want to tweak the .htaccess file that is provided by default under the public/ directory.

Below are the 2 Apache configuration files required to configure LESK to run under the directory /lesk-sp.

Here is a example of a modified .htaccess configuration file:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews

    RewriteEngine On

    # Sets the base URL for per-directory rewrites
    RewriteBase /lesk-sp/

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

Note the addition of the RewriteBase directive pointing to the directory of the application.

And here is the matching /etc/httpd/conf.d/lesk-sp.conf:

Alias /lesk-sp /var/www/lesk-sp/public

<Directory "/var/www/lesk-sp/public">
    AllowOverride all
    Order allow,deny
    Allow from all