WordPress.org

Ready to get started?Download WordPress

Forums

WP Mod Rewrite - How does it work? (6 posts)

  1. alli14x
    Member
    Posted 5 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! =]

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    WordPress does use an .htaccess file, so I'm not sure what exactly you're talking about...

  3. alli14x
    Member
    Posted 5 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.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    The WP_Rewrite class does all that. Look in wp-includes/rewrite.php. It's highly complicated though, more than I understand fully. :)

  5. alli14x
    Member
    Posted 5 years ago #

    cool, thanks man =]

  6. Ogre
    Member
    Posted 5 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.

Topic Closed

This topic has been closed to new replies.

About this Topic