Drupal redirect in .htaccess
November 11, 2009
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 <a href="http://example.com/,<br /> " title="http://example.com/,<br /> ">http://example.com/,<br /> </a> # uncomment the following line: # RewriteBase /
#custom redirectsRewriteRule ^oldpath$ <a href="http://www.example.com/newpath" title="http://www.example.com/newpath">http://www.example.com/newpath</a> [R=301,L] #end custom redirects
More info on Ping Vision
Learn how to write custom Drupal modules
Does Drupal module development make your head explode and drive you crazy?
Why not learn from someone who has paved the way instead?
Sign up to Master Drupal 7 Module Development.
I am
Post new comment