Drupal redirect in .htaccess
Using .htaccess is one of the best ways to redirect a URL to a new URL. Particular care needs to be taken with Drupal sites for it to work correctly.
The following snippets needs to be added to the root .htaccess file directly after the following lines:
- # Various rewrite rules.
- <IfModule mod_rewrite.c>
- RewriteEngine on
- # If your site is running in a VirtualDocumentRoot at http://example.com/,
- # uncomment the following line:
- # RewriteBase /
- #custom redirectsRewriteRule ^oldpath$ http://www.example.com/newpath [R=301,L]
- #end custom redirects