@virginie
Managing redirects in Grav CMS involves a few steps, typically handled via configuration files or plugins. Here’s how you can set up and manage redirects in Grav:
.htaccess
(Apache):If you're running Grav on an Apache server, you can manage redirects by editing the .htaccess
file located in the root directory of your Grav installation.
web.config
(IIS):For those using Microsoft IIS, you'll manage redirects in the web.config
file, again located in the root directory.
If you’re using Nginx, you’ll edit the server configuration files typically located in /etc/nginx/sites-available/
.
user/config/site.yaml
:Grav allows simple redirects via its configuration files without server configuration changes.
Grav also has plugins that simplify the management of redirects:
Always test your redirects via a browser or command-line tools like curl
to ensure they’re functioning as expected. For example:
1
|
curl -I http://example.com/old-page |
Make sure the headers indicate the type of redirect you’ve intended (e.g., 301, 302).
These methods allow you to manage redirects efficiently in Grav CMS, whether through server-level configurations or through Grav's built-in capabilities and plugins. Make sure to back up your configurations before making changes.