I want this url
http://www.test.racebooking.net/rankings/classifica.html
to point to
http://www.test.racebooking.net/rankings.php
thus, i wrote this rule in my .htaccess file
RewriteRule ^rankings\/[a-zA-Z0-9\-]+\.html$ /rankings.php
I really can't figure out why, when i type the first url, i get a 404 error msg.
- RewriteEngine is on.
- /rankings.php exists.
- Moreover, I have another RewriteRule, much more complex, which i wrote, which is working like charm.
- classifica.html doesn't exist. I'm just updating my website with more SEO friendly urls
What's wrong with my rule??
When i test the regexp in any online regexp tester it detects the string "rankings/classifica.html", this means the regexp actually corresponds, but nothing is working....
I found the error, but i didn't find out why it happens.
Basically, if pattern and substitution start with the same word, the RewriteRule doesn't work.
EXAMPLE
If i write this rule in .htaccess:
and type this URL
I get a 404 Error. Even if the Regexp is correct, the apache RewriteEngine is not working. Instead, if i write this rule:
and type this URL
Everything works fine.