1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress and Permalinks

Discussion in 'PHP' started by SGBoise, Feb 16, 2010.

  1. #1
    Hey everyone,

    I'm working on a little project for redirecting wordpress links to another cms.

    I can't find how wordpress knows which record to pull when the permalink is set to month and name.

    Which looks looks like this: http://test.com/wp/2010/02/sample-post/

    I know it uses .htaccess to redirect to index.php but I'm not which function actually does the sql query to find the row.

    Does anyone know or can point me in the right direction?
     
    SGBoise, Feb 16, 2010 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,494
    Likes Received:
    4,457
    Best Answers:
    123
    Trophy Points:
    665
    #2
    It's pretty confusing under the covers... why don't you just use htaccess to run the redirect. Faster and easier!
     
    sarahk, Feb 16, 2010 IP
  3. SGBoise

    SGBoise Peon

    Messages:
    647
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can't use htaccess redirect because there is no way of knowing the row id since the row id is not in the url.
     
    SGBoise, Feb 24, 2010 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,494
    Likes Received:
    4,457
    Best Answers:
    123
    Trophy Points:
    665
    #4
    It'll be looking for the slug on that date - not a difficult query to write yourself... and it relies on there not being two records with the same slug on any given month.
     
    sarahk, Feb 24, 2010 IP