[wp-hackers] Custom Permalink Rewrite Rules
pbaylies at semperfiwebdesign.com
Thu Aug 23 00:23:56 UTC 2012
Would the template_redirect action work for what you're doing here?
-- Peter Baylies
Semper Fi Web Design
On Wed, Aug 22, 2012 at 7:50 PM, Matt Slocum <mattslocum at sharefaith.com>wrote:
> Hi all,
> I'm trying to add my own custom url structure to my plugin that will allow
> a specific url to access a different php file. For example, I want
> www.domain.com/awesomeness/ should load a special php application in my
> plugin: wp-content/plugins/myplugin/awesomeness.php. This 'awesomeness.php'
> file will do its own thing and call exit().
> I was trying to do all this using a rewrite rule, but I can't get it to
> work. I've resorted to hooking the wp_loaded action and looking in
> $_SERVER['REQUEST_URI'] to see if it matches. The thing is, I still don't
> want to allow users to make a page/post called 'awesomeness' because it no
> longer is navigable. So it seems like I still need to add a custom
> Other thought: I've also thought about using add_feed() or
> add_rewrite_endpoint() because then my awesomeness script would know what
> page to work on. My current method will know what page to work on based on
> what comes after /awesomeness/ (ex:
> Sorry about being vague here. Please don't let my adding of a new tag
> distract the conversation of how to add the custom permalink structure.
> :-) Does anyone have any experience doing odd rewrites or have any
> articles about it?
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers