rewrite rule does not rewrite url as expected

Posted by user1708687 on Server Fault See other posts from Server Fault or by user1708687
Published on 2014-06-13T07:23:52Z Indexed on 2014/06/13 9:28 UTC
Read the original article Hit count: 446

Filed under:
|

I have a problem with a CMS website, that normally generates readable urls. Sometimes it happens that navigation links are shown as www.domain.com/22, which results in an error, instead of www.domain.com/contact. I have not found a solution for this yet, but the page is working if the url is www.domain.com/index.php?id=22.

Therefore, I'm trying to rewrite www.domain.com/22 to www.domain.com/index.php?id=22 and I have used this rewrite rule:

RewriteRule ^([1-9][0-9]*)$ index.php?id=$1 [NC]

I tested it using http://htaccess.madewithlove.be and here it shows the correct result, but on the website no rewrite is happening.

© Server Fault or respective owner

Related posts about .htaccess

Related posts about mod-rewrite