2

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 Answer 1

2

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

1

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.