This is the .htaccess code for permalinks in WordPress. I don't understand how this works. Can someone explain?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I googled and found out that -f
and -d
part means to give real directories and files higher priority.
But then what are ^index\.php$ - [L]
and RewriteRule . /index.php [L]
?
How does WordPress process categories, tags, pages, and etc. with just this?
Does it happen internally? If so, I'm interested in learning how to do it in PHP.
Thanks