Question

I am rebuilding a static website for a client using Wordpress on the main domain- eg domain.com. There is also a directory of members website at directory.domain.com which I was hoping to migrate over to the main website- domain.com/directory/ (We want to do this, firstly to keep it on the same domain, but also so that we may be able to use the same layout and styles- preferably by using a page template.)

The app has a main page, a list view and a member details view, and search queries are sent using $_GET. URLs are made to look nice (semantic URLs) by using mod_rewrite eg: directory.domain.com/list/people/all/by-name/page-1/20-per-page/

example code from the .htaccess file could be:

RewriteRule ^list/([a-zA-Z0-9-\-]+)/([a-zA-Z0-9-\-]+)/([a-zA-Z0-9-\-]+)/$ /list.html?member-type=$1&area-name=$2&order-by=$3 [L]

I've thought of two possibilities in which to achieve the above...

1) If we kept the directory of members on the different subdomain then it might be possible to cache and use a copy of a blank page on the WP site and then use this as a template for the directory of members.

2) Somehow have the php code of the directory of members within a WP page.

Ideally I want to go for (2), but I am not sure how to implement this.

So what's the best way to achieve this? Specifically...

  • How do I run the PHP for the app within a WP page?
  • How do I access the $_GET variables and enable nice (semantic) urls using mod_rewrite? For example, if the directory is on domain.com/directory/ how do I get it to pass $_GET variables by extending the url but keeping the same WP page, eg. domain.com/directory/list/people/all/by-name/page-1/20-per-page/ ?

Sorry if I haven't explained this very well, it's a little complicated!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top