@hanna
Managing URL aliases in Drupal is an effective way to ensure that your site has clean, user-friendly URLs, which can improve both usability and search engine optimization (SEO). Here's how you can manage URL aliases in Drupal:
Using the Admin Interface
- Access URL Aliases:
Navigate to the admin interface by going to Configuration > Search and metadata > URL aliases.
- Add a New Alias:
Click on the Add alias button to create a new alias.
Specify the system path (e.g., node/1) and the alias you’d like (e.g., /about-us).
Save the new alias.
- Edit or Delete Existing Aliases:
In the URL aliases page, you can view the list of existing aliases.
To edit or delete an alias, find the alias you want to change, and use the corresponding edit or delete option.
Using Pathauto Module
Pathauto is a popular Drupal module for automatically generating URL aliases based on configurable patterns.
- Install Pathauto:
Ensure that you have the Pathauto module installed and enabled.
You also need the Token module, as Pathauto relies on it.
- Configure URL Patterns:
Go to Configuration > Search and metadata > URL aliases > Patterns.
Here, you can define patterns for generating automatic aliases.
Use tokens to set dynamic values. For example, a pattern for content could be content/[node:title].
- Bulk Generate Aliases:
If you need to create aliases for existing content, use the Bulk generate tab on the URL alias configuration page.
Choose which aliases to generate and run the bulk update.
Clean URLs
- Ensure that your Drupal site is set up to use Clean URLs. This setting can be checked and configured under Configuration > Search and metadata > Clean URLs.
SEO and Best Practices
- SEO Optimization:
Create URLs that are descriptive and relevant to the content.
Avoid using excessively long or superfluous words in aliases.
Stick to consistent URL structures and patterns.
- Redirection:
When you change URLs, use the Redirect module to create 301 redirects from the old URL to the new one.
This helps maintain SEO rankings and provides a seamless user experience.
Additional Tips
- Caching:
Clear caches after adding or changing aliases to ensure that the changes take effect site-wide.
- Path Access:
Ensure proper permissions for users to create or edit URL aliases, typically managed in People > Permissions.
By using the above methods, you can effectively manage URL aliases in Drupal to enhance your website's structure and usability.