I have a custom post whose name is "babysitter".
I wrote this in my .htaccess:
RewriteRule ^babysitter/?$ /index.php/some-page/ [QSA,L]
In layman terms, if url matches hostname.com/babysitter or hostname.com/babysitter/ go to hostname.com/index.php/some-page.
The strange behaviour I get is that this doesn't work (I mean RewriteRule is not matched) and I get a 404 error but even stranger is that this doesn't work even for strings starting with the first letters of babysitter and are substrings of it for example:
baby or bab or babys.
Instead it works if I write ababy or everything else which doesn't begin with custom post name:
RewriteRule ^ababysitter/?$ /index.php/some-page/ [QSA,L] RewriteRule ^ababy/?$ /index.php/some-page/ [QSA,L] RewriteRule ^abc/?$ /index.php/some-page/ [QSA,L] RewriteRule ^cba/?$ /index.php/some-page/ [QSA,L]
For all the rules just above urls:
bring me to hostname.com/index.php/some-page which is what I want.
IS THIS A BUG IN WORDPRESS?
Basically what I am trying to achieve is that, if "babysitter" is a custom post:
hostname.it/babysitter gives me a page;
hostname.it/babysitter/4567 gives me the post page;