0

I got a custom menu plugin in Magento2 as below.

class TopmenuPlugin {

    public function afterGetHtml(\Magento\Theme\Block\Html\Topmenu $topmenu, $html) {

    $html = '';
    $html .= "<li class=\"level0 nav-1 level-top parent ui-menu-item\">";
    $html .= "<a href='\index.php' class='level-top ui-corner-all' aria-haspopup=\"true\" tabindex=\"-1\" role=\"menuitem\"><span class=\"ui-menu-icon ui-icon ui-icon-carat-1-e\"></span><span>" . __("Home") . "</span></a>";
    $html .= "</li>";
    ....

In Chrome and IE the URL is

http://website.com/index.php

In Firefox the URL is

http://website.com\/index.php

And in Firefox I am getting Whoops, our bad... error

Is there something I am missing here????

2 Answers 2

1

After I change from

<a href='\index.php'

to

<a href='/index.php'

it works great.

0

How is your base url set? Because if your base url is http://website.com\ by accident then u will have this problem. stores --> configuration --> general --> web. It should be http://website.com/

6
  • The base URL is already as http://website.com/ Apr 25, 2016 at 22:54
  • Can u try clearing your cookie and cache following these steps :support.mozilla.org/nl/questions/951951
    – Versdivers
    Apr 25, 2016 at 22:56
  • Also clear the cache of the website and run php bin/magento indexer:reindex
    – Versdivers
    Apr 25, 2016 at 22:57
  • I cleared everything in firefox. Cleared the Magento cache and rebuilt the indexes... fyi.. I installed firefox few minutes before just for testing this issue. Apr 25, 2016 at 23:00
  • Can u post your php.ini settings? I know there is a settings that defines if u allow file links or not. It seems that this link has been marked as a file link for some reason and then it does that in firefox appearently. If thats not the case then i'm out of idea's xd wish u the best luck though
    – Versdivers
    Apr 25, 2016 at 23:11

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.