Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The Apache web server does already know such a concept:</p> <ul> <li><p><a href="http://httpd.apache.org/docs/2.2/content-negotiation.html#multiviews" rel="nofollow">MultiViews</a>:</p> <blockquote> <p>The effect of <code>MultiViews</code> is as follows: if the server receives a request for <code>/some/dir/foo</code>, if <code>/some/dir</code> has <code>MultiViews</code> enabled, and <code>/some/dir/foo</code> does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.</p> </blockquote></li> <li><p><a href="http://httpd.apache.org/docs/2.2/mod/core.html#acceptpathinfo" rel="nofollow">Path Info</a>:</p> <blockquote> <p>This directive controls whether requests that contain trailing pathname information that follows an actual filename (or non-existent file in an existing directory) will be accepted or rejected. The trailing pathname information can be made available to scripts in the <code>PATH_INFO</code> environment variable.</p> <p>For example, assume the location <code>/test/</code> points to a directory that contains only the single file <code>here.html</code>. Then requests for <code>/test/here.html/more</code> and <code>/test/nothere.html/more</code> both collect <code>/more</code> as <code>PATH_INFO</code>.</p> </blockquote></li> </ul> <p>All you then need to adjust is to take the path info part and parse it.</p> <p>Besides that, if you really want to implement that behavior with mod_rewrite, try this:</p> <pre><code>RewriteCond %{DOCUMENT_ROOT}/$0.php !-f RewriteRule ^(.+)/([^/]+)/([^/]+)$ /$1?$2=$3 [N,QSA] RewriteCond %{DOCUMENT_ROOT}/$0.php -f RewriteRule .+ /$0.php [L] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload