Module for 301 redirects from static pages?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
NikLP's picture

I'm wondering if there would be a way to create a module that would do 301 redirects from static pages to Drupal pages.

That is, if I have a site constructed of old html pages, and I upgrade the client to Drupal, I am in theory faced with having to cut and paste the content from the old page into a node form of some sort. This is fine.

However, in order for the page rank of this old html page to be maintained, I need to point SEs to the new node rather than the old page.

Would it be possible to do this with a module?

Relating to this: http://drupal.org/node/16084

Comments

Import HTML

funana's picture

I can't help you with the 301 for static pages, I'm sorry, but as I read about "cut & paste" the old pages, do you know http://drupal.org/project/import_html ?

Edit: Do you have access to your .htaccess file?

Then why don't you use something like this:

Redirect 301 /folder/page.html http://www.domain.com/page

__

SEO Tips For Successful Drupal Sites
__
Cape Verde News & Community
My Info Collection

.htaccess and version control

harking's picture

If you are storing your Drupal install in a vcs, updating becomes a pain if you put the redirects into the .htaccess file.

On the other hand, using a .htaccess file is quite a bit faster than loading Drupal just to perform a redirect. ;)

pain?

greggles's picture

Can you elaborate on why/how that is a pain? It seems fine to me.

--
Knaddisons Denver Life | mmm Free Range Burritos

path redirect

greggles's picture

The path redirect module will do this for you. After I've moved sites from static HTML (or another system or...) I like to watch my "page not found" errors for a few days and just create 301 redirects as necessary.

On larger sites with a more automated migration process you can create the 301 redirects in path redirect directly in the database table. I've used that system as well and it worked fine.

http://drupal.org/project/path_redirect

--
Knaddison Family | mmm Beta Burritos

Update:

NikLP's picture

FYI anyone who comes across this looking for tips...

globalredirect.module is now at 5.x-1.0 status but you need the dev version (which works fine in my experience)
path_redirect.module is now at 5.x-1.x-dev status - this works fine as far as I can see though

For people managing their own sites, John Forsythe posted this article earlier today, which may be of use to some.

thanks Path redirect works.

polishyourimage's picture

thanks Path redirect works. at first I thought it only redirected internal Drupal paths (because that's what the documentation says), but I tried a regular mypage.html path and it worked, thx!

Path redirect with subdomains

codeman1234's picture

Hey guys,

I am trying to redirect a subdomain but, doesn't let me do it with redirect on drupal 7, how can I redirect subdomains then?

Cheers!!

Search Engine Optimization (SEO)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week