Hitesh_Sharma is experiencing issues with a custom route in Discourse, where specific URLs are not being ignored as expected. The code in the routes.rb file is:
Hitesh_Sharma explains that the custom route is used to redirect old Drupal URLs to Discourse topics, but the current implementation is blocking some URLs like login and signup.
Canapin asked for more context, and pfaffman suggested using permalink redirects and permalink normalizations instead of custom routes. However, Hitesh_Sharma clarified that permalinks are not being used in their Discourse setup and is seeking help to resolve the issue with their current code.
I am using custom functionality for the Drupal URL topic shown in the discourse
site.
When a user visits the old URL of the Drupal site in a web browser, the system first checks in custom routes. It either ignores certain specified URLs as mentioned in custom routes, or it goes to the ‘custom_redirect’ function. In the ‘custom_redirect’ function, it finds the topic in Discourse and redirects the browser to that link.
If you’re trying to get drupal URLs to 301 to the proper Discourse topic then you want to use permalink redirects and probably permalink normalizations.
If you used an import script, it should have created permalinks, which you can see at /admin/customize/permalinks. If they aren’t working then you can use a permalink normalization to fix them up.