Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>While the correct way is typically accepted as URL rewriting using .htaccess as @Nathan has shown, you can also optionally use <code>MultiViews</code> on a per-directory basis:</p> <pre><code>&lt;Directory /home/www/sitename/htdocs&gt; Options + MultiViews &lt;/Directory&gt; </code></pre> <p>Multiviews, on 404 from an unknown file extension, will begin searching for a match in the filename. That is, if the URI is <code>foo</code>, it'll look for <code>foo.*</code>; that said, it could potentially find <code>foo.gif</code>, <code>foo.jpg</code>, <code>foo.html</code>, etc., and will return the highest quality option.</p> <p>If you're certain you could provide all your content on a unique-name basis (shouldn't be hard), then by all means use this. Then just change all your anchors to direct to <code>somepage?product=343&amp;type=4</code> instead of <code>somepage.php?product=343&amp;type=4</code></p> <p><strong>edit</strong>:</p> <p>Yes, such links can be made even cleaner. Using URL rewriting, you could rewrite your URLs to:</p> <p><code>somepage/product/343/type/4</code> or <code>somepage/343/4</code></p> <p>This is done by the appropriate (respective) regex:</p> <pre><code> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)$ $1.php?$2=$3&amp;$4=$5 [L,QSA] </code></pre> <p>or</p> <pre><code> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)/(.*)$ $1.php?product=$2&amp;type=$3 [L,QSA] </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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