WordPress.org

Ready to get started?Download WordPress

Forums

Building cruft-free WP urls. help with 404.php (7 posts)

  1. Anonymous
    Unregistered
    Posted 9 years ago #

    I've build a plugin that will change all the links to cruft-free URLs, like /category/post-name/, /category/ etc.
    Next step is to build 404.php so that it parses this, populates category_name and name values in the querystring and pass them all to /index.php.
    Problem is, when I do header(Location: ..), it also changes the URL displayed in user browser. This is similar to ASP's Response.Redirect.
    Is there anything in PHP that is equivalent to ASP's Server.Redirect() which does server transfer but does not "inform" user browser about that, so the URL is still the same?

  2. Matt Mullenweg
    Troublemaker
    Posted 9 years ago #

    This is built-in to 1.3 already.

  3. Anonymous
    Unregistered
    Posted 9 years ago #

    Yes, I tried it, but it did not worked. When I set permalink structure to /%category%/%postname%/ it either threw an error or returned 0 posts. I tried two nightlies (Oct 10 and 14, I think).
    Anw, I tend to use stable versions, so I'm moving to WP 1.2.1, where the above links are not possible.
    However...am I right that I can use the 1.3alpha rewrite rules for the above structure, and that they will work in 1.2.1 too? I'm still preparing the files and awaiting an answer from hosting company, so can't try it yet myself.
    I completed the plugin stuff and tested using Win2k3 server and custom 404.php.

  4. Brak
    Member
    Posted 9 years ago #

    /%category%/%postname%/ does not work. It causes issues everywhere throughout the site. Namely, you can't access /wp-admin/ or any subcategories for that matter. The rewrite rules need to be re-thought, because to me, /%category%/%postname%/ is by far the best choice.

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    This would be cool... Have you guys found a PHP equivalent to ASP's server.transfer()? I need to transfer file execution on the server w/out causing a browser redirect. I'd love to find a way in PHP... thanks.

  6. Brak
    Member
    Posted 9 years ago #

    Umm.. it's quite simple.
    ob_clean() // Get rid of anything that was already spit out
    include "file.php";

  7. Anonymous
    Unregistered
    Posted 9 years ago #

    thanks for the help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.