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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…