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
Does Drupal development make your head explode and drive you crazy?
Why not learn from someone who has paved the way instead?
Sign up to my upcoming learning series.
I am Blair Wadman and this is where I write about Drupal, PHP, CSS etc
© Blair Wadman
2005 - 2011
Post new comment