On my website, I would rename the URL on address bar, from
domain.com/economy/article.php?id=00
to
domain.com/economy/id-name-article.html
I wrote this .htaccess file:
RewriteEngine On
RewriteRule ^([0-9]+)-([^\.]*)\.html$ http://domain.com/economy/article.php?id=$1 [L]
I have an anchor with this href: href="economy/id-name-article.html"
and when I click on it, the server is redirected on article.php
, it runs the script in the correct way and I can view the article, but on the address bar is still written domain.com/economy/article.php?id=00
instead domain.com/economy/id-name-article.html
. Why?
This happens only on my online server, while locally it's all right.