1

How should I approach this issue?

I want to create one page, but many "virtual pages", e.g. like a productinfo.php. A product has several. In this case you manually create the posts in the database through dashboard and the virtual pages are pointing to specific posts in the WP database.

What I want is this is kind of same thing but I don't want to add any posts and I want all virtual pages to redirect to same page with different GET request:

Let met explain:

  1. I create one page: e.g. cityinfo
  2. If I go to /luton it should point to cityinfo?actualcity=Luton
  3. If I go to /london it should point to cityinfo?actualcity=London etc.

Should I be using .htaccess for this? Or am I missing some easier/better way to achieve this?

0

1 Answer 1

1

I actually found a rather easy way to achieve this:

add_rewrite_rule( 'city/([a-zA-Z]+)/?$', 
'wp-content/plugins/csv-to-html/templates/csvtohtmlpage_core.php?city=$1' );

Yes, I know I did not mention city/ in the beginning but I just wanted wanted to know how should I achieve this. If someone has better ideas. Please tell me! :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.