Support » Developing with WordPress » Custom Prefix in URL Rewriting

  • Hello,
    for the permalinks i’m using:
    Date and name based

    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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


    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.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Prefix in URL Rewriting’ is closed to new replies.