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:

  1. # Various rewrite rules.
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine on
  4. .......
  5. # If your site is running in a VirtualDocumentRoot at http://example.com/,
  6. # uncomment the following line:
  7. # RewriteBase /
  1. #custom redirectsRewriteRule ^oldpath$ http://www.example.com/newpath [R=301,L]
  2. #end custom redirects

More info on Ping Vision

Add new comment