Step 1:
Create and put below content to the file named "redirect.phtml" and place under "/template/page/html/".Mage::getSingleton('customer/session')->setBeforeAuthUrl($this->getRequest()->getRequestUri()); //save requested URL for later redirection if(!Mage::getSingleton('customer/session')->isLoggedIn()) { // if not logged in header("Status: 301"); header('Location: '.$this->getUrl('customer/account/login')) ; // send to the login page exit; }
Step 2:
Edit "page.xml" and place the codeafter
Step 3:
Edit the below files "template/page/"1. 1column.phtml
2. 2columns-left.phtml
3. 2columns-right.phtml
4. 3columns.phtml
and Insert the following line at the start of all the files.
echo $this->getChildHtml('auth-redirect')
Step 4:
Now Add exceptions for home, login and cms page.Edit your "layout/customer.xml"
Add below code
under
Also If you want users to be able to create an account, another good one to make public might be place code under
in "layout/customer.xml"
If you want to make the home (front) page public, add the "remove" code to the
No comments:
Post a Comment