Note that there are some explanatory texts on larger screens.

plurals
  1. PO.htaccess mod_rewrite problem - shot myself in the foot?
    text
    copied!<p>I have a page called category.php5 that uses $_GET["category"] to fetch the right content from the database. I want to pretty it up so is looks like:</p> <p>sinaesthesia.co.uk/category/psoriasis</p> <p>which would equal:</p> <p>sinaesthesia.co.uk/category.php5?category=psoriasis</p> <p>I have successfully done this sort of rewriting before, but since I can't get it to work now, I'm worred that I might have rules in place that are somehow screwing me. Here is my entire .htaccess file - the last couple of lines are supposed to do the above rewrite:</p> <pre><code>RewriteEngine On #remember to change this to aromaclear RewriteCond %{HTTP_HOST} !^sinaesthesia\.co.uk$ [NC] RewriteRule ^(.*)$ http://sinaesthesia.co.uk/$1 [R=301,L] #Translate default page to root RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php5|html)\ HTTP RewriteRule ^(.*)index\.(php5|html)$ /$1 [R=301,L] #translate any .html ending into .php5 RewriteRule ^(.*)\.html$ /$1\.php5 #change / for ? RewriteRule ^(.*)\.html/(.*)$ /$1\.html?$2 #strip .html from search res page RewriteRule ^(.*)search/(.*)$ /$1search_results\.html/search=$2 #translate product details link from search res page RewriteRule ^products/(.*)/(.*)/(.*)$ /product_details.php5?category=$1&amp;title=$2&amp;id=$3 [L] #Translate products/psorisis/chamomile-skin-cream-P[x] to productview.php5?id=1 RewriteRule ^products/.*-P([0-9]+) /productview.php5?id=$1 [L] #Translate /category/psoriasis to /category.php5?category=$1 RewriteRule ^category/(.*) /category.php5?category=$1 [L] </code></pre> <p>When I manually enter category.php5/category=psoriasis, it works great. When I enter category.php5/category/psoriasis, it doesn't. I'm worried that my line that changes a html/ to html? is an error, however when I take that line out, it still doesn't work. Everything else works as expected. </p>
 

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