Note that there are some explanatory texts on larger screens.

plurals
  1. POmod_rewrite and GoDaddy
    primarykey
    data
    text
    <p>I really have only a fair idea of what I am doing. Sorry.</p> <p>This is what I did to rewrite URLs like these:</p> <pre><code>http://example.com/foo/bar/news/1-category-name/2-item-name http://example.com/foo/bar/news/1-category-name </code></pre> <p>into these:</p> <pre><code>http://example.com/foo/bar/news.php?newsID=2 http://example.com/foo/bar/news-categories.php?categID=1 </code></pre> <p>respectively</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine on RewriteBase /foo/bar RewriteRule ^news\/([^\/]+)/([0-9]+)-([^\/]+)$ news.php?newsID=$3 RewriteRule ^news\/([0-9]+)-([^\/]+)$ news-categories.php?categID=$1 &lt;/IfModule&gt; </code></pre> <p>But whenever I try this URL: </p> <pre><code>http://example.com/foo/bar/news/16-news-category-1/11-title </code></pre> <p>It always returns a <code>404</code> error:</p> <p><em>The requested URL /foo/bar/news.html/16-news-category-1/11-title was not found on this server</em></p> <p>Why is it trying to find <code>news.html</code>? What am I doing wrong?</p> <p>I don't know if this is relevant but <code>example.com</code> is <em>virtual</em> (I really don't know the term). The actual files can also be accessed via <code>http://real-domain.com/qux/</code>. So you'd do <code>http://real-domain.com/qux/foo/bar/news/1-category-name/2-item-name</code> to get to <code>2-item-name</code>.</p> <p>Does it also help to say that this script actually runs on my development machine?</p> <pre><code>Development: PHP v5.3.5 Apache v2.2 Live: PHP v5.3.6 Apache v2.2 </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.
 

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