I’ve been trying to get some rewrite rules working translated from Apache but for some reason I can’t get it it to work.
The Apache rules are…
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+).html$ m/$2.php
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+).html$ m/$2/$3.php
I’ve translated that to…
rewrite {
r ^\/m\/([a-zA-Z0-9_-]+)\.html$
to /m/{1}.php
r ^\/m\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)\.html$
to /m/{1}/{2}.php
}
So when I try to access /m/something.html it should rewrite to /m/something.php and the second rule… /m/foo/bar.html should translate to /m/foo/bar.php
However I just get a 404 when trying to access these URLs. From what I can tell everything looks correct but I must be missing something.
Any help would be appreciated.