I have a .htaccess as follows and some rules are conflicting - I need to somehow make a condition so they don't
RewriteEngine On
RewriteRule ^search$ results_template.php [L]
RewriteRule ^load-([a-z0-9-]+)$ index.php?key=$1 [L]
RewriteRule ^([a-z0-9-]+)$ http://domain.com/share/index.php?key=$1 [L]
The .htaccess file is located at http://domain.com/directory/.htaccess
The first rule is supposed to just rewrite the name search
to results_template.php
and stop processing more rules
http://domain.com/directory/search
loads
http://domain.com/directory/results_template.php
The second rule is supposed to take the abcdef-1
from
http://domain.com/directory/load-abcdef-1
and send it as a parameter to
http://domain.com/directory/index.php?key=abcdef-1
and then stop processing rules.
The third rule is supposed to take the abcdef-1
from
http://domain.com/directory/abcdef-1
and send it as a parameter to
http://domain.com/share/index.php?key=abcdef-1
and then stop processing rules.
The problem I'm having is no matter how I try to make these play nicely together whenever I request http://domain.com/directory/search the third rule is invoked and I'm redirected.
I'm sure it's just complete tiredness or complete stupidity but I've been at this small step for too many hours now so any help would really be good. Thanks