Hackwar / jlrouter

GNU General Public License v3.0
8 stars 1 forks source link

Redirect legacy routes to modern routes #2

Open piotr-cz opened 7 years ago

piotr-cz commented 7 years ago

Is there a recommended strategy to redirect legacy routes to modern ones? The site I'm working with has 1000 articles which are crawled by google and linked by 3p sites. I have had to change most URLs some time ago on site refresh and I'd prefer not to do it again.

Hackwar commented 7 years ago

Did you check if the URLs even change? The new router in general only has different URLs to the old one when the URL points to a category or article at least 2 levels further up from the category linked in the menu item. 90% of all sites should see no difference.

For the other sites I'm looking into creating some code that parses the old URLs and then redirects to the new URL. But that will still take some time.

franzpeter commented 7 years ago

I have a website with Joomla and Virtuemart and I had to change nothing except of telling Virtuemart to use the full category path. So far, no problem with the new router. @Hackwar, thanks to provide the modern router as plugin, so everybody can try it out and decide to use or not use it!!! I did not understand the decision to remove the modern router from J 3.7 and postpone it again. Even in J 3.7 there was a simple switch to use or not use it. So where was the problem?

Gitjk commented 7 years ago

After some testing I also use your new router with my live Joomla 3.6.5/VirtueMart shop. Runs just fine without any issues. Didn't notice any change in the urls after installing jlrouter.zip and setting all options to enabled. Many thanks!

Los-Carnales commented 7 years ago

@Hackwar , Is there any way to see the URLs that the router creates in a file?. If we work on localhost with Joomla 3.6.5 and when it is necessary to update the stable version 3.7, will the URLs created by the router be compatible or what will happen?. I know that is not easy task this project, but it really is the best future solution to modify URL in Joomla, without using external components for SEFURL. I think that if the people in charge of the Joomla project take very seriously the work that has done in this plugin, we will all win in the future of Joomla. All this always thinking about JLRouter is included by default inside the package of Joomla, so I've tried so far I see that you do not have the options presented by the external SEF components, but the most valuable of your work with JLRouter is that we can edit URL to the fly and we do not have to walk editing URLs 3000 times with an external component.

Hackwar commented 7 years ago

The URLs generated by this new router are 90% backwards compatible. The only URLs not compatible with this are URLs that are more than one child-category deep from a menu item. To give you an example, old URLs would look something like this: /menu-item/23-category-1/category-2/42-article-alias and the new URLs would be /menu-item/12-category-1/23-category-2/42-article-alias

There is no list of URLs that this router produces, since these are all created dynamically.

Los-Carnales commented 7 years ago

@Hackwar So the compatibility of URLs in either 3.6.5 3.7 3.8 or version 4.0 will always continue to depend on whether we cast from a menu item. But after 10 years with Joomla as it is possible we still depend on a menu item to be able to route a URL or something in Joomla and that does not fail anything. The problem here is that it is not only that the router generates the URLs correctly, the problem is basically the dependency of the menu, since we will always have to create for example: 1000 tag from the Joomla tag component and to correctly rotate we will have to create 1000 items in an invisible menu. This is still crazy for any administrator of a Joomla site.

In reference to there is no list of URLs. But the router creates the URLs dynamically and does not generate duplicate or unwanted URLs even though these URLs are not linked in any menu or published in the Joomla site ?.

Hackwar commented 7 years ago

You don't have to create "a thousand menu items for a thousand tags". One menu item that links to the tags view is enough. Resulting in domain.tld//

The router does not generate duplicate URLs and as long as you configure your site correctly (creating menu items for the right things) you will not have unwanted URLs.

Los-Carnales commented 7 years ago

@Hackwar It will not be necessary in the case that a user needs to only bind all tags within a linked URL from a menu item. But if a user needs to create a URL for each tag, he has to go through creating an invisible menu with a parent element and the rest of the tags that are children of this item. If you do not link a tag created in the tag component from a menu the URL is as follows: /component/tags/tag/ID-tag.html, if you link the tag from a menu item you can edit it to your liking for example: / Parent Item menu / nameoftag.html . Perfect that it does not generate duplicate URLs, but you give me the reason that we will continue to depend on the menu items so that the structure of the URLs will not be broken or generated correctly.

Los-Carnales commented 7 years ago

@Hackwar In addition to what I say, if you create a tag without a link from a menu item you can only edit the URL but still have the ID before the URL, also not depending on a menu you can not have, for example: Inside the module "Breadcrumbs" or assign modules to this label just like we can do when the label is linked from a menu item.