1

Can I use Regex in the URL Redirect section in Magentos backend? Or any wildcards?

Thanks

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Nov 21, 2014 at 9:34

1 Answer 1

0

From what I know you cannot do that.
The rewrites are processed in Mage_Core_Model_Url_Rewrite::rewrite method.
I didn't find anything in there that could handle a regex.
To simplify what that method does: It takes the current url, checks if there is a record in the core_url_rewrite table with the request_path matching the current url and redirects (in browser or internally) to the target_path then restarts the process until there is no matching value in that table or until you reach 100 redirects.
If you don't reach 100 redirects, the last url you get as a target path is handled by the rest of the routers: it checks if the url key matches any cms page identifier or it maps to this format module/controller/action.

But I think you can write you own router that can handle regex.
Inchoo provides (as always) a great tutorial on how to create your own router

answered Nov 21, 2014 at 9:46

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.