PHP Classes

File: manuscript/Pretty URLs.md

Recommend this page to a friend!
  Classes of Gjero Krsteski   PIMF   manuscript/Pretty URLs.md   Download  
File: manuscript/Pretty URLs.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PIMF
Framework for Web application development
Author: By
Last change: Update of manuscript/Pretty URLs.md
Date: 5 months ago
Size: 798 bytes
 

Contents

Class file image Download

Pretty URLs

Apache

The framework quick-starters ship with a .htaccess file that is used to allow URLs without index.php. If you use Apache to serve your PIMF application, be sure to enable the mod_rewrite module.

If the .htaccess file that ships with PIMF does not work with your Apache installation, try this one:

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [QSA,L]
    </IfModule>

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

Nginx

On Nginx, the following directive in your site configuration will allow pretty URLs:

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }