Verizon cell phones

Redirects In Drupal

Drupal logo
Today I was faced with a reorganization of one of my websites to make it more URL and category friendly. After the change, I quickly found out that my URLs in Google searches were naturally were throwing up HTTP 404 errors. So I had to remedy the situation by using HTTP 301 redirects. With Drupal, it is a little more trickier to fix. Here's how.



The problem of course, was that Drupal was rewriting the URLs in .htaccess. After fussing around a bit I came up with the following solution.

In your website's main folder, locate this line:

RewriteBase /

Please all your 301 URL redirects after that line:


RewriteRule ^path/to/url1$ http://www.site.com/newpath1 [R=301,L]
RewriteRule ^path/to/url2$ http://www.site.com/newpath2 [R=301,L]

Filed under: