Pretty Links with custom wordpress application
-
Greetings again!
Right off the bat, I should probably say I do not know enough about WordPress; I’m probably making a rookie mistake and just don’t know it. Here’s the situation:
– I built a tool that uses WordPress for Theme and user management, but otherwise doesn’t use WordPress features (see my first question)
– I bundled the tool up as a WordPress Plugin and “Installed” it on our server.
– All of our links to the tool look like this:https://www.becomemagi.com/wp-content/plugins/cardchooser/index.php
https://www.becomemagi.com/wp-content/plugins/cardchooser/createCard.php?c=2783
https://www.becomemagi.com/wp-content/plugins/cardchooser/index_art.php
https://www.becomemagi.com/wp-content/plugins/cardchooser/createArt.php?c=574and we’d love for them to be
https://www.becomemagi.com/library/
https://www.becomemagi.com/library/card/2783
https://www.becomemagi.com/library/art/
https://www.becomemagi.com/library/art/574The problem is…. Nothing I do with the rewrite rules seems to work. I’ve attempted to replicate the example here for the first rule (main index) as:
add_filter( 'rewrite_rules_array','fcn_rewrite' ); function fcn_rewrite($rules){ $newrules = array(); $newrules['library/'] = 'wp-content/plugins/cardchooser/'; return $newrules + $rules; }
and then calling flush_rewrite_rules(false); in my plugin activation. I AM seeing the rule get written to the DB, but when I go to
https://www.becomemagi.com/library/
All I get is a 404. I THINK it should be replacing “library/” with “wp-content/plugins/cardchooser/”, but apparently I’m not entirely understanding.
Any guidance? I think once I solve the mystery of this, I’ll be able to implement the rest of the rules easily:
$newrules[‘library/card/(\d+)’]= ‘wp-content/plugins/cardchooser/createCard.php?c=$matches[1]’;
$newrules[‘library/art/(\d+)’]= ‘wp-content/plugins/cardchooser/createArt.php?c=$matches[1]’;
$newrules[‘library/art/’]= ‘wp-content/plugins/cardchooser/index_art.php’;
$newrules[‘library/’]= ‘wp-content/plugins/cardchooser/index.php’;Thank you all for any help!
- The topic ‘Pretty Links with custom wordpress application’ is closed to new replies.