1

Currently I struggle on a following problem. How can we have a url http://www.example.com/custom/custom/query which would point to http://www.yourwebsite.co.uk/custom/custom/index assuming that query can be anything. (without using .htaccess)

I did it in Magento 1 using url_rewrite in config.xml like this:

<rewrite>
    <fancy_url>
        <from><![CDATA[/custom\/custom\/(.*)/]]></from>
        <to><![CDATA[/custom/custom/index/]]></to>
        <complete>1</complete>
    </fancy_url>
</rewrite>

Is it possible (in anyway) in Magento 2?

Thanks

1

You can implement this logic in custom router (\Magento\Framework\App\RouterInterface). See \Magento\UrlRewrite\Controller\Router as example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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