Skip to content

Shortening URL

Uroš Preložnik edited this page Jun 1, 2018 · 6 revisions

With this guide you will remove /gisportal/index.php from URL.

1. Apache configuration

Add this to VirtualHost tag for site hosting gisportal (above existing RewriteRules). Adjust your paths if necessary.

If you followed gisapp setup you have this configuration prepared in /etc/apache2/conf-enabled/gisapp.conf. Just edit that file and uncomment some lines to have configuration below:

#Enable this when shortening gisportal URL
DocumentRoot /var/www/html/gisportal/

#Enable this when shortening gisportal URL and you already used gisportal so you need redirection
#redirect old gisportal links to root
Redirect /gisportal/ /

#allow htaccess
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Alias /gisapp/ /var/www/html/gisapp/

2. Gisportal .htaccess

Edit .htaccess in /gisportal/ folder and remove comment to get this:

	RewriteEngine On
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ index.php/$1 [L]

If after complete setup you get errors on start screen use this instead of last line

	RewriteRule ^(.*)$ index.php?/$1 [L]

3. Gisportal config.php

Edit /gisportal/application/config/config.php:

	$config['base_url'] = 'http://your_server/'; //just remove gisportal/ part

	$config['index_page'] = ''; //remove index.php

4. Gisapp settings.js

Edit settings at the bottom of gisapp/client_common/settings.js like this:

	Eqwc.settings.gisPortalRoot = '/';
	Eqwc.settings.mailServiceUrl = Eqwc.settings.gisPortalRoot + 'mail/send';
	Eqwc.settings.gisPortalProfile = Eqwc.settings.gisPortalRoot + 'profile';

5. Restart Apache

Restart Apache and open web browser to try this (better to close and reopen browser if you have link previously opened). If you have problems look first at point nr. 2. above!