0

This might be easy to accomplish but I stuck ...

I had this Zend application installed on http://www.example.com using Zend_Auth to identify if user can see the rest of the page. So I have code like

if (!Zend_Auth::getInstance()->hasIdentity()) {
$this->_helper->redirector('login', 'login');
}

Now I Install WordPress under http://www.example.com/blog/

And using .htaccess to allow access to the blog as below and the same time, zend application can work

RewriteRule ^blog - [NC,L]
RewriteRule ^.*$ public/index [NC,L]

However, I don't want anyone to see the blog, only people who login to zend be able to see it.

I am guessing the logic should be 1. put this blog under Zend directory somewhere as external application 2. Use Zend Controller to allow access to this page?

But how can I implement this ? Any help is appreciated.

Mike C
  • 60
  • 7
  • Inspired by http://stackoverflow.com/questions/377628/can-i-integrate-a-zend-framework-powered-web-application-into-a-wordpress-site , I will use below require_once('Zend/Loader.php'); Zend_Loader::registerAutoload(); – Mike C Sep 10 '11 at 06:37

1 Answers1

1

The best way of doing this is by creating a Wordpress Module,

The simples way of doing this is by modifying pulic/blog/index.php Include zend session and the code to check the auth. If auth does not exist or is invalid redirect to login.

For the rewrite you might want to redirect anything that starts with blog in the url to the wordpress index to be compatible with fancy url's.

Perfection
  • 199
  • 1
  • 10
  • thanks for that, I thought of that too, But do I need to include Zend Class to use zend session? Since the Zend application has it's own url rule, how can I refer the proper zend class ? – Mike C Sep 10 '11 at 04:11