Creating 301 redirects for Drupal

Comments

SEO Position writes:

Hi Laura,
I'm missing the "RewriteBase /" in your first snippet above. That might be my problem with getting 301 permanent redirects to work correctly on a couple of Drupal sites.
I was curious to see if you knew how to redirect something like this:

/cg--bin/* (and everything within it)
to
/ (home page)

we also have another one called /main/ that needs redirected.

We are also using pathauto. Thanks for any help.

PS - What kind of Captcha do you use? I like it.

Laura writes:

RewriteRule ^[old-path](.+)$ http://domain.com/[new-path]$1 [R=301,L]

I'm not a *nix guru, but this has worked for me in the past. That would make yours:

RewriteRule ^cgi-bin/(.+)$ http://domain.com/$1 [R=301,L]

You'll definitely want to test this first.

The captcha is from the contributed modules on Drupal.org.

Freeware Eugen writes:

Hi Laura,
i tested it --> function perfect!
Thx!
I downloaded captcha module for drupal, will test it :)
Thx for tip!
Greets from Germany
Freeware Eugen

Matt C writes:

Brilliant!
I've been searching for hours to try and fix this (I was trying to get a php page to do the processing, but couldn't get drupal to send me there).
Thank you so much.

Laura writes:

Yes you can just redirect those specific posts to URLs at another domain.