I've got a script that echoes a meta redirect to some page known as account_management.php5, but for whatever reason it instantly redirects after that to index.php5. My .htaccess file handles a few redirects instantly, for instance index.htmlphp5 towards the domain root, and that is the only real place I can tell this issue coming initially from, however i do not understand why. This really is my .htaccess file:

RewriteEngine On

#remember to change this to aromaclear
RewriteCond %{HTTP_HOST} !^sinaesthesia\.co.uk$ [NC]
RewriteRule ^(.*)$ http://sinaesthesia.co.uk/$1 [R=301,L]

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&title=$2&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]

Add this soon after RewriteEngine on

RewriteLogLevel 9
RewriteLog /tmp/rw.log

Then restart the webserver. It will assist you to debug the issue.

Edit: Sorry, I did not spot the .htaccess above. This can only work in the primary apache configuration file.


RewriteRule ^(.*)\.html$ /$1\.php5


RewriteRule ^(.*)\.html$ /$1.php5


RewriteRule ^(.*)\.html$ /$1.php5 [QSA]

This same mistake of getting away special chars within the second param of RewriteRule is going on in other rules too, I'm not sure if apache will handle it, however i know you do not need it because second param isn't a regexp.

Never rival %{THE_REQUEST}, thats a strange factor to complete, you do not need that. Furthermore, this problem is okay without them. Just put there:

RewriteRule ^(.*)index\.(php5|html)$ $1 [R=301,QSA,L]

Now view it:

RewriteRule ^(.*)\.html/(.*)$ /$1.html?$2

First, you're still accepting that you will find references to .html files, soon after attempting to translate all .html to .php5, there is something wrong here.
Furthermore, you're defineing as QueryString something which was initially personal files path, and therefore are not really putting it inside a key. It will not work, it need more treatment.

#strip .html from search res page
RewriteRule ^(.*)search/(.*)$ /$1search_results.html/search=$2

Wasn't it designed to strip the .html? Since it is really putting b .html code there. Maybe because it is no [L] it get fixed within the next loop, however, you could just get all fixed the following.

#translate product details link from search res page
RewriteRule ^products/(.*)/(.*)/(.*)$ /product_details.php5?category=$1&title=$2&id=$3 [L]

That one filled with .* is potentially unstable, specifically delimitating the finish. You want to do this:

RewriteRule ^products/([^/]*)/([^/]*)/([^/]*) /product_details.php5?category=$1&title=$2&id=$3 [L]
# or:
RewriteRule ^products/(.*?)/(.*?)/([^/]*) /product_details.php5?category=$1&title=$2&id=$3 [L]

The final one looks correct, except that you ought to strip the special character that might be faced like a range delimiter, the "-". I do not think it work following a *, but simply to be certain and proper the syntax:

RewriteRule ^products/.*\-P([0-9]+) /productview.php5?id=$1 [L]

Egads - my stoopidity knows no bounds! I will not even embarass myself using the particulars. Sorry, men!