WordPress/OIOpublisher RewriteRule (Blank Page) Fix

travish

Nobody Important
Feb 16, 2010
33
0
0
USA
For those of you that run OIOpublisher on WordPress - fix that ugly purchase URL! You know the one I'm talking about:

Code:
http://example.com/wp-content/plugins/oiopub-direct/purchase.php
This fix assumes:

You have custom permalinks enabled and ending with /%postname%/
You have the latest version of OIOpublisher (2.23 at the time of this post).
You have a page on your site to presell advertising space - we'll stick with "advertise" for the sake of this example.

---------------------------------------------------------------------------------------------------------------------

This fix makes it possible to presell advertising on an "advertise" page AND rewrite the wp-content/plugins/oiopub-direct/purchase.php URL into advertise/purchase.php.

So you'll have a working http://example.com/advertise/ that you can link to http://example.com/advertise/purchase.php

Your prolly saying "But the script does this on it's own", and your HALF right. The script DOES rewrite wp-content/plugins/oiopub-direct/purchase.php into advertise/purchase.php.

What the script ALSO does is make it impossible to access http://example.com/advertise/ once it's updated with the rewrite.

We're going to fix that.

Lets start from the top.

----------------------------------------

Install and activate OIOpublisher.
Navigate to the OIOpublisher settings page. Scroll to the bottom.
In the Rewrite Script URL box, enter: http://example.com/advertise - Update settings.
Take the code OIO gives you, and add it to your .htaccess file as you should. Save file.
Navigate to your WordPress Dashboard >> Pages. Hover over your "Advertise" page. Take note of the URL in the status bar. It will look like: http://example.com/?page_id=X - where X is the page_id number. Take note of the ENTIRE URL.

Put this:

Code:
RewriteRule ^advertise/$ http://example.com/?page_id=X [L]
into your .htaccess file, DIRECTLY ABOVE

Code:
RewriteRule ^advertise/(.*)$ wp-content/plugins/oiopub-direct/$1 [L]
Save and upload .htaccess.

The resulting .htaccess should look something like this:

Code:
## OIOpublisher Rewrite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^advertise/$ http://example.com/?page_id=X [L]
RewriteRule ^advertise/(.*)$ wp-content/plugins/oiopub-direct/$1 [L]
Remember to replace the X with the page_id.

You now have a working http://example.com/advertise/ that you can presell your ad space and link to http://example.com/advertise/purchase.php for the backend - instead of http://example.com/wp-content/plugins/oiopub-direct/purchase.php.

No more having to put a "contact me" link on your advertise pages - or a link through that fuggly URL.