WordPress.org

Ready to get started?Download WordPress

Forums

Custom variables, rewrites, redirects, etc. (2 posts)

  1. Mat Gargano
    Member
    Posted 4 years ago #

    Hi All:

    Not sure if this is the right place to ask, but I am in the process of converting a hand coded (PHP) baseball statistics site to wordpress' CMS and wanted to know if what I wanted to do is accomplishable (is that a word lol).

    This may be confusing, but currently when calling a baseball player's career statistics, I set up the following:

    1. the file player.php?playerid=(playerid)
    2. this pings my database and returns the player's first name and last name and redirects the url to player.php?playerid=(playerid)&firstname=(firstname)&lastname=(lastname)
    3. this gets rewritten as: /player/(playerID)/(firstname).(lastname).html

    (the rewrite, and pulling of the player's first and last name is done for SEO purposes)

    so for instance if i wish to look up david wright (who's playerid is wrighda03) i simply call /player/wrighda03/david.wright.html

    is there any way to do that by creating a "page" in wordpress?

    let me know if this does not make sense!

    thanks,

    matstars

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    is there any way to do that by creating a "page" in wordpress?

    Well no, it's not all going to happen automatically by creating a page, but it's definitely possible...

    This may yield some answers for you.
    http://codex.wordpress.org/Function_Reference/WP_Rewrite

    Personally i place custom rules before the WP stuff in the .htaccess, but there's no advantage to that approach over the one's shown on the codex page, apart from being a bit quicker for testing and writing rules (imo)..

    Why not setup a local installation and do some rewrite rule tests ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.