Drupal redirect in .htaccess

Description

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.

RewriteEngine on
.......
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

More info on Ping Vision

Snippet

#custom redirectsRewriteRule ^oldpath$ http://www.example.com/newpath [R=301,L]
#end custom redirects

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options