Killian M. Mathieu Killian M. Mathieu -4 years ago 53
PHP Question

Magento 1.8 only some CMS pages 302 redirects to home page

I've got a problem with my Magento CMS pages. On my homepage I've got footer links that bring the customer to CMS pages with success when they're clicked.

I tried to add 2 more links with their own CMS pages and impossible to access them.
The working links look like this:

<li class="uppercase"><a href="<?php echo $this->getUrl('qui-sommes-nous') ?>" title="<?php echo $this->__('Who are we ?') ?>"><?php echo $this->__('Who are we ?') ?></a></li>


Then, for the same code with the correct link it redirects my link to the homepage with a 302 code.

I went to a redirect checker website and it said that I had 302 redirects on the homepage when I click only on my new links only.

I already did the following:
Go to my admin panel to uncheck Redirect to Base Url;

Go to {MagentoRootFolder}/app/etc/modules and remove modules one by one to see if there is a module that creates the issue.

Look in my .htaccess to comment Redirect directives.

I don't find the origin of this redirection if someone could help.

Thanks.

Answer Source

I found the problem.

It came from the fact that previous developers blacklisted all CMS pages in a Module Observer but the ones on the homepage (the ones which works) so I added my CMS pages to the whitelist and it works fine now.

if (Mage::getStoreConfig('privatesales/forcelogin/enable')) {

        $requestPathWhiteList = array(

            '[Path you want to whitelist]',
            '[Path you want to whitelist]',
            '[Path you want to whitelist]',
            '[Path you want to whitelist]',
            '[Path you want to whitelist]',
        );

        $cmsPageIdentifierWhiteList = array(
            '[URL KEY of your cms page you want to whitelist]',
            '[URL KEY of your cms page you want to whitelist]',
            '[URL KEY of your cms page you want to whitelist]',
        );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download