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.1   Updated Thursday, February 19th, 2009 at 7:19pm

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

  If you have found this page useful, please consider donating. Thanks!

Change Log

  • 02-19-09 Version 1.1 – Updated to work better with newer versions of WordPress
  • 03-19-06 Version 1.0 – Initial release

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: « 4 3 2 [1] Show All

  1. _ck_: Perhaps. I may add support for a password or something at some point, but it seems kind of pointless, since there should not really be anything in the redirect rules that is ’sensitive’.

  2. 14
    _ck_

    Could you consider adding a security feature so that only the administrator can see the redirect page? Like a cookie check or something, not sure…

  3. [...] I tried to find a way to use /year/month/date/slug/ structure in my permalinks and also allow posts to be accessed by the slug only. Choosing either one was easy but having them both working at the same time seemed to be a problem for my WordPress installation. Adding new rewrite rules was easy after I found Rewrite viewer plugin but still WP just didn’t show up the posts. This was important because I wanted to use the long form and also let old Textpattern permalinks work as they used to. [...]

  4. Mani: Glad you found it useful! :)

  5. Congrats, U can not imagine how I reached this page! I wanted to add some custom rewrites to debug some 1.5->2.0.2 upgrade problems, I guessed they might be a tool to help me add some custom RewriteRules to WP , your plugin was just two clicks away from me, It was a great example, Thank you very much :)

  6. Axel: Did you try disabling your other plugins? What version of WP are you using? Also, did you try clicking the ‘update permalink structure’ button in the WP options?

  7. I liked the idea of this plugin. Unfortunately when I install it all I get at /rewrites/ is a 404 error…

  8. Hi Admin,
    Thank for the tip but apeerantly the problem was caused by some strage bug, aminly a missing tag in the “single.php” template file as described here : http://wordpress.org/support/topic/35805.
    Thank you though!

  9. Sarit: What version of WordPress do you have? Newer versions of WordPress keep most of the rewrite rules internally, but there still should be some WordPress stuff in the .htaccess no matter what version you use.

    Perhaps WordPress does not have write access to your .htaccess file. Make sure you set the permissions (CHMOD) on the file to 666 (or 777 depending on your config). Then in your options, click the ‘Update Permalink Structure’ button again, and see if it will recreate the entries. :)

  10. So here’s a dummie’s question;
    I’m having problems with permalinks, they lead to blank pages. My .htaccess file contains nothing but FeedBurner code (no Wordpress code), however I did set a permalink structure in my Wordpress admin panel.
    I installed this plugin to see if I get anything else (maybe.. I don’t know a thing about htaccess) but when I try to access http://www.my-paradox.net/rewrites/ it keeps loading the index page.

    Any idea why?
    Thank you!
    Sarit

  11. Hey,

    Well, sorry for bothering you, just found out my friend added a new plug-in:

    http://fucoder.com/code/permalink-redirect/

    So you just have to tell it not to touch your plug-in and now it works fine. :)

    Take Care,

    Will

  12. Will: I am not sure what the problem could be, especially since it was working. Did you add any other plugins or anything? Or change anything else?

    I would re-download the plugin, and update your permalinks again. I would also edit one of your posts, because that forces WP to re-create those things.

  13. Hey,

    Well, shoot I must have screwed something up. Now when I vist http://www.war59312.com/rewrites/ it just goes to http://www.war59312.com/ . :(

    I see this is in my htaccess file:

    RewriteRule ^rewrites/? /index.php?showrewrites=1 [QSA,L]

    So it should be working right? It was working fine and I have no idea why its not working now.

    I also tried to “Update Permalink Structure”, but no difference. And yes the plug-in is enabled.

    Any ideas?

    Thanks,

    Will

  14. Glad you like it :)

  15. Hey,

    Thanks for this very nice plug-in. :D

    I was looking for a faster way to see what htaccess rules my wp code where creating; sure beats the heck out of having to download my htaccess file every time to check. ;)

    Take Care,

    Will

Pages: « 4 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.