WordPress.org

Ready to get started?Download WordPress

Forums

Custom Prefix in URL Rewriting (3 posts)

  1. shoombool
    Member
    Posted 6 years ago #

    Hello,
    for the permalinks i'm using:
    Date and name based
    ยป http://www.hype1.com/wordpress/index.php/2007/07/11/sample-post/

    the problem i'm having is that i need to pass a variable to ALL the pages. my variable is called city and it contains the city name. So i want this variable passed around to all the pages within wordpress so i can display correct advertisment. Any ideas how i can accomplish this with URL rewriting?

    when i turn it to default, i hardcoded the city=$city in the proper files. But i can't understand the rewrite functions!

    any help would be appreciated!

  2. ccoupe
    Member
    Posted 6 years ago #

    This is more a question than an answer.

    What are you getting the city/$city from? If it's from a cookie or HTTP headers no url rewriting is needed. But it you had to, it would be of the form

    http://.../2007/07/11/sample-post&city=Denver&state=Co&Country=USA

    Or something kind of close to that. How you get those values and pass them is more of a php thing that a WP permalinks question.

  3. ccoupe
    Member
    Posted 6 years ago #

    I should have looked at your site first. Oops. My Bad. The google ads seem to be personalized for my location on the home page. Those other pages are not WordPress though, from what I looked at, so you need to pass what they need not what WP needs.

    I'd guess you need to write a new cookie for your site, transforming the google values to what ever the site behind wants. Interesting problem but not one I'm going to investigate here. Too much hard work and thinking.

    FWIW, the site is really slow.

Topic Closed

This topic has been closed to new replies.

About this Topic