$_GET Clean URLs (2 posts)

  1. danzigism
    Posted 4 years ago #

    Hello there,

    My current permalink setttings are set to just: /%postname%/

    I have a custom page template that has one simple $_GET variable. I actually use this $_GET variable to assist me with querying certain posts and outputting them in XML.

    For example: http://domain.com/my-xml-page?type=someterm

    I'd like to figure out how I can possibly clean up this url as such:


    The thing is, I only want this to apply this specific page template. Not all of WordPress.

    Anybody know of a solution? Thanks for your help!

  2. jevets
    Posted 4 years ago #

    Start here Rewrite_API

    * Use add_rewrite_rule() and add_rewrite_tag()
    * Hook into a page load (maybe the hook template_redirect) and check to see if the current page/post uses the specific template

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.