httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael B Allen <>
Subject [users@httpd] Invoking PHP without .php extension?
Date Thu, 07 Jul 2011 17:54:54 GMT
I want a request like:


to invoke a particular PHP file for everything under /base.

It seems the usual way (only way?) to do this is with something like:

  AddHandler php5-script .php
  AddType text/html .php
  DirectoryIndex index.php

and with directives like:

  Alias /base /path/to/base/html

  <Directory "/path/to/base/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

    RewriteEngine on
    RewriteBase /base
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]

However this is a disaster. The request for
/base/path/to/target?foo=bar is received inside the PHP script as
/base/index.php/path/to/target?foo=bar. Now the application has to
have intimate knowledge of the presence of the extra /index.php
segment and exclude it from URLs and paths emitted by the application.
The internal representation doesn't match the reality of the external

So my question is, is there a way to directly invoke a preconfigured
PHP script for everything at / under a certain location without using
the .php extension in the request path?


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message