Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.0   Updated Sunday, March 19th, 2006 at 1:13pm

Internal Rewrite Viewer Plugin for WordPress

This plugin has a very specific purpose - to generate a list of the current rewrite rules that WordPress is using. Unless you are writing WordPress plugins that support permalinks, this plugin will probably not be that useful to you. But if for whatever reason you need to check the rules (for debugging.. troubleshooting..) it will do the job nicely. Only newer versions of WordPress store the rules internally of course. If you have a much older version, the data will simply be in your .htaccess file.

Download

Notice

This plugin will only work if you are using custom permalinks (not the WordPress default), and have allowed WordPress to add the proper code to .htaccess

Instructions

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory.
  • Enable the plugin in your WordPress control panel.
  • Try it out by going to: http://(your wordpress install)/rewrites/
  • NOTE: If that link does not work for you, try this:
    http://(your wordpress install)/index.php/rewrites/
    The link for usage may vary depending on your permalink configuration.

Example

Take a look at my rewrite page.

How it works

This plugin works by using a rewrite rule to generate a ‘fake’ page for the rewrite viewer. This is really only a call to the index with a new variable passed. When the index page detects this variable, it generates a list of the rules instead of the index page.

Of course for this plugin to work, you must be using permalinks, but if you were not, you would not be using this plugin anyway ;)

Pages: [3] 2 1 » Show All

  1. I am using permalinks and a installed your plugin But all I am getting is a 404 page.
    http://www.xhydra.com/blog/rewrite/

  2. hello, I recently create wp blog, how can i install wp-rewrite plugin. existing url does not work. http://www.worldnetzone.com/ any body can help please?

  3. rahul: This plugin simply lists the rules WordPress is using - it will not allow you to modify existing rules.

  4. 38
    rahul

    1) can U tell me how to remove those new entries from the Rewrite Entries.
    Basically I want to revert my Rewrite Rules to default.
    2) I am not able to add any more entries. Yesterady I added 3 entries to my rewrite rules. they show up in the WP_OPTIONS table. but i dont know why this plugin is NOT CONSISTENT.

  5. Thanks man. Now I finally can figure out how to fix my 404 category pages.

  6. Michel: If you have not already, I would try backing up .htaccess, emptying it, making sure it is set for write-permissions, then clicking ‘Update Permalinks’ in the admin panel. It should force a complete rebuild of them all.

  7. Neither works for me.

    I tried:
    http://www.michelfortin.com/rewrites/

    And:
    http://www.michelfortin.com/index.php/rewrites/

    Something’s fishy going on with my rewrites, which is why I would have loved it if this plugin would work. But this may be the very reason it doesn’t!

  8. LiewCF: Even calling it directly does not seem to work: http://www.liewcf.com/blog/index.php?showrewrites=1

    It does indeed sound like this is due to a plugin - it may just be a matter of going through them all to see which one. Unless it is something that was directly added to your .htaccess file.

    There is still another option you can try. Add this code somewhere in your template’s index.php file, then refresh your page:

    <?php print_r($wp_rewrite->rewrite_rules()); ?>

    It will make the page look strange probably, but you can copy the text quickly, and then remove the code. Then you will have the rules to look at :)

  9. thanks for the reply. That’s the reason I want to use your plugin to find which rules redirect to blog page… The actual path of my WordPress is http://www.liewcf.com/blog/

  10. LiewCF: It looks like you have something in place already which is adding rewrite rules, which may be keeping this from working. For example, when I go straight to your URL, it takes me to your blog page, etc.. I would try temporarily disabling whatever is doing that. What is the actual path to your WordPress install?

  11. hi, I recently upgraded my blog to WP2.0.7 from WP1.5. I install your plugin but the url does not work. You can test it at http://www.liewcf.com/blog/rewrite/
    help please?

Pages: [3] 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.