WordPress uses friendly seo url without using htaccess.
Can any explain this to me please how they do it.
The only way i can think of is to do something like this.
domain.com/index.php/nnn/mmmm/
But wordpress does not use index.php
I know they are not using htaccess.
Please let me know.
Thank you.
WordPress actually has a single .htaccess file that they don’t need to change which redirects all requests to index.php
index.php then looks at the permalinks rules and runs a few database queries to determine which page to send you.
So for instance if the permalink rule is
%postdate%/%postname%(may not be the actual WordPress permalink variables. I haven’t been using WordPress for too long) then it would just use regular expressions (or combinations ofsubstr()andstrpos()) to put%postdate%and%postname%into variables. Next it runs a simple database query for any item matching that date and that name. If nothing is found, redirect to search. If you find more than one, list them all (like a category page). If you find one and only one, send that page.As far as actually “sending” the page, that’s just a matter of settings certain variables (such as
$the_post['content']) and theninclude()‘ing the proper theme file.include()‘ing the theme file is a simpleif()statement.Mind you these aren’t the exact variable names or the exact functions as they occur. This is just a very simplified version to give the general idea of how these systems work.