AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Drupal pathauto9/13/2023 Installing the Redirect module will automatically take care of this for you. While this is actually the exact same page, search engines will find both URLs, see them as unique URLs and penalize the site for having duplicate content. have aliases, they are available at multiple URLs.įor example, "Test Article #1" is available at both: "node/1" and "blog/2012/11/test-article-1". Now, I haven't purposefully created duplicate content, but because all of our content, users, etc. Duplicate content is when the same content is available at multiple URLs. Search engines don't like it when a site has "duplicate content". There's one problem with stopping our setup here. (ie: the edit page.) We have duplicate content Now, when we go to a user profile, all of the tabs will link to aliased versions of the path, including "administration paths". Uncheck the box "Skip administration paths from sub-path processing.".Go to "Configuration => Search and metadata => URL aliases => Sub-path settings" (admin/config/search/path/subpaths).We can change this behavior on the Sub-path settings page. These are considered administration paths, and Sub-pathauto skips processing on these by default. URLs like "user/1/edit" and "user/1/shortcuts" are not aliased by default. So, because "user/1" has been aliased to "users/brian", the Sub-pathauto module knows to also alias "user/1/contact" to "users/brian/contact" Configure Aliasing administration URLs This time, if we click the "Contact" tab, we are taken to "users/brian/contact". You can find Sub-pathauto at /project/subpathauto Installĭemonstrate the new path alias for contact/edit/etc. It is currently co-maintained by Frederik 'Freso' S. Co-Maintainers Pathauto was originally written by mikeryan and maintained by Greg Knaddison (greggles). In order to use Sub-pathauto, all we need to do is enable the module. In Drupal 8, Pathauto uses the API provided by Drupal core. The Sub-pathauto module will automatically create a URL alias for every URL that is based on, or extends an existing alias. Pathauto has created the URL alias "users/brian" but it does not affect other URLs that include the pattern within a larger path, so, if we tried to go to "users/brian/contact", we would get a "Page not found" error. If we click it, we are taken to "user/1/contact". Here, you'll notice that the path is "users/brian", and we can see the "contact" tab. In Firefox, as an anonymous user, click on "Brian" to view the user profile.Enable "Personal contact form" at "user/1/edit".Check the boxes next to "View user profiles" for the "Anonymous user" and "Authenticated user" roles.Check the boxes next to "Use users' personal contact forms" for the "Anonymous user" and "Authenticated user" roles.Go to "People => Permissions" (admin/people/permissions).Enable "Contact" module and allow all users to view user profiles In the end I would recommend 2 or 3 solutions as 1 will also work but then If you want to use breadcrumbs and i18n then you will probably have problems there and you are then better of with 2, maybe no.3 solution.In this video, we'll take a look at creating sub-path aliases using the Sub-pathauto module.įirst I'm going to enable the core "Contact" module, and then allow both anonymous and authenticated users to view user profiles. switcher if you don't want pages not found.Īlso follow this thread to see what is happening with this problem and possible solutions. Also you can't use language switcher as taxonomies are not connected and you need to make custom lang. Use separate taxonomies for each language, there is a problem when you choose your term, if you are using english interface (/en) and you are editing french taxonomy no hierarchy will be shown and you need to switch to (/fr) to add your node to proper parent/place in hierarchy. Use Translate option, then you will have your aliases translated, and everything should work fine but you will have all of your terms listed in the same list, so when you choose your term in dropdown and you have many terms this will get overcrowded andģ. You can also try this module /project/pathauto_i18n_taxonomy it should bulk create your aliases, you should setup all of your patterns to / for example and the delete old aliases and then bulk update new ones. Solution is to have terms localized, then you can manually make URL's for all of your languages and their taxonomies, because if you don't you will have one alias for them all. Well you will have problems, here are some solutions depending on the which type of multilanguage option you choose for your taxonomyġ. Well you want to use i18n taxonomy and have nice site, that is optimized for SEO and for viewers.
0 Comments
Read More
Leave a Reply. |