As of gpEasy 1.6.1, you are able to use apache's rewrite module (mod_rewrite) to hide the index.php portion of urls. To enable this feature you'll need an Apache installation with mod_rewrite and .htaccess.

gpEasy CMS 1.7 now offers permalink options. See "Admin" menu -> "Permalinks"

Within the permalinks settings you have the option to hide or show "index.php" in the URL. If mod_rewrite is enable gpEasy will be able to setup the correct .htaccess file with proper mod_rewrite rules to hide index.php. However, if you do not have the proper permissions or mod_rewrite is not enable this feature will not work.

Setup

To set up this feature, you'll need to create an .htaccess file and edit your index.php file.

.htaccess file

Below is an example of an .htaccess file. Note the RewriteRule at the bottom: this is written for an installation within the /glacier/ subdirectory. If your installation is a root installation, you'll want to change that line to RewriteRule (.*) /index.php [L].

<IfModule mod_rewrite.c>
	RewriteEngine On

	# Don't Rewrite For These filetypes
	# you may want to add other extensions like mp3|mpeg|wav|pdf|xml|txt
	RewriteCond %{REQUEST_URI}	!\.(bmp|css|gif|ico|jpg|jpeg|js|png|shtml|zip)$ [NC]

	# Don't Rewrite For Existing Files
	RewriteCond %{REQUEST_FILENAME} !-f [NC]

	# Don't Rewrite For Existing Directories Except for the root directory
	RewriteCond %{REQUEST_FILENAME} !-d [NC,OR]
	RewriteCond %{REQUEST_URI}	^/$

	RewriteRule (.*) /glacier/index.php [L]
</IfModule>

Telling gpEasy To Hide index.php

Adding the .htaccess code above won't always work by itself. Sometimes, you'll need to tell gpEasy that it should use links without index.php in them.

Note: gpEasy uses one of two configuration files. Open your installation directory and if you have a gpconfig.php file, use that file. Otherwise use the index.php file.

Within your configuration file, you'll need to uncomment the gp_indexphp declaration and make sure it's value is false.

<?php
//define('gpdebug',true);
define('gp_indexphp',false);

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

Log In

  Register