alli14x
Member
Posted 4 years ago #
Hi,
I'm I wasn't sure where to post this but here goes, just a short and probably complicated question.
How does wordpress perform its URL rewriting? As there isn't a .htaccess file present?
Any points in the right direction or explanations would be greatly appreciated.
Thanks! =]
WordPress does use an .htaccess file, so I'm not sure what exactly you're talking about...
alli14x
Member
Posted 4 years ago #
Whoops, hadn't turned on pretty links so the htaccess file hadn't been generated.
It has now which I guess points all requests to the index.php file, I was just curious as to how say a list of rewritten url's could be stored in a database instead of being detailed in an .htaccess file.
But as all requests are sent to index.php I assume some form of check is done at run-time.
The WP_Rewrite class does all that. Look in wp-includes/rewrite.php. It's highly complicated though, more than I understand fully. :)
alli14x
Member
Posted 4 years ago #
To quote from the mod_rewrite documentation, "Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo."
I have found that it sometimes requires you sacrifice a live chicken under the light of a full moon to get things to work, and I'm a trained professional.