Mike C
Mike C

Reputation: 60

install WordPress with Zend, use Zend_Auth to allow view WordPress Posts

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.

Upvotes: 0

Views: 491

Answers (1)

Perfection
Perfection

Reputation: 199

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.

Upvotes: 1

Related Questions