This is driving me insane - I have certain links that are re-written on a site that work perfectly fine (and I am not new to re-wring urls) but have just found that some others aren't and I cannot fathom out why.
What works:
// The link
<a href="/shop/<?php echo $parent_category['slug']; ?>/products">
// The RewriteRule
RewriteRule ^shop/([a-zA-Z0-9_-]+)/products/?$ /shop/diesel-products.php?slug=$1
What is not working:
// The link
<a href="/faqs/<?php echo $faq['slug']; ?>">
//The RewiteRule
RewriteRule ^faqs/([a-zA-Z0-9_-]+)/?$ /faqs?slug=$1
// Also tried
RewriteRule ^faqs/([a-zA-Z0-9_-]+)/?$ /faqs.php?slug=$1
What am I missing??
Just for reference (if it has any bearing) I am also using .htaccess to accept links without file extensions using:
# show file names without .php extension
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)/?$ $1.php [L,QSA]