I have created an addon with a custom controller but want to use seo friendly urls for it instead of index.php?dispatch=my_addon
I added a rewrite into the .htaccess:
eg. RewriteRule my_addon index.php?dispatch=my_addon
but it doesn't work. going to example.com/my_addon just goes around in a redirect circle until it gives up. Going to index.php?dispatch=my_addon directly works fine.
Add the dispatch “my_addon” and value “my-addon” via Website > SEO Rules menu to automatically create the SEO name “my-addon”, thus, it becomes accessible at yoursite.com/my-addon
Try using Website->SEO Rules instead.
That's great, the only problem is that it keeps changing what I put in and I think its because there's a conflict with a category name. The reason I have a category with the same name is to use as a placeholder on the menu.
eg. Category Structure:
Shop
|----Category 1
|-----Category 2
|-----My Addon
The Menu is set to use “Shop” as the category for generating the submenu. The menu needs to show the subcategories for category1 & category 2 & my addon and they only way I could find to do that was to to create empty categories and then rewrite the urls to go to my add-on but when I try to add my-addon it gets renamed to my-addon-en which doesn't happen with my-other-addon (which doesn't conflict with a category name)
Any ideas?
SEO Names must be unique, therefore you cannot have two instances of “my-addon”.
Why don't you create a custom menu in Design>Menus, with the same structure? That would solve all of your problems and means you will not need to create any categories to use as placeholders.