0

I'm dealing with a site that's had Multistore set up by using Configuration > Web > Url options > Add Store Code to Urls.

Most everything works fine, except for some Modules producing 404 pages in the Administration area. For example, the MageStore Giftvoucher uses the URL giftvoucheradmin/adminhtml_giftvoucher/index. Our admin path is simple /admin so Magento is presuming that giftvoucheradmin is a store URL and therefore throws up a 404.

This also became a bigger issue when we switched from using /admin as our administration path to something more secure (eg /new_admin_path), and got 404's throughout the admin.

After a considerable amount of debugging I found that adding the following into a custom module config.xml file solved the issue;

<global>
...
<request>
        <direct_front_name>
            <new_admin_path />
        </direct_front_name>
    </request>
...
</global>

Now I could add a node into request > direct_front_name for each of the URLs used that aren't store codes, frankly though it seems like a poor solution.

Is the only other way around this to change how the stores are configured, as outlined here by Ben Marks?

2 Answers 2

1

This might be: Since SUPEE-6788 / 1.9.2.2 you are no longer allowed to use your own admin urls, therefore this is default behaviour.

Either you are fixing/updating the module or you set the compatibility mode introduced in the patch to active.

1
  • Not so I'm afraid. I was experiencing this on a store without this patch applied. And - that patch affects modules that use their own admin URL, NOT stores that have a different URL set in local.xml. As I understand anyway...
    – thebluefox
    Commented Jan 30, 2016 at 14:22
1

As Fabian pointed out, modules should not use their own admin url's. Most modules have supplied a fix for this to make them part of the admin endpoint.

However, the admin endpoint also suffers from the issue when the Add Store Code to Urls config setting is enabled and a custom admin url is used:

  • accessing the admin using /new_admin_path redirects to /admin/new_admin_path/index/noRoute
  • accessing the admin using /admin/new_admin_path does work.

Setting the global/request/direct_front_name/new_admin_path XML node in a local module or in in app/etc/local.xml resolves this issue: it tells Magento to not use the store code for the custom admin endpoint.

BTW Magento also uses this setting itself for the /xmlconnect and /api endpoints, which should also be accessible without store code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.