Prime 357

We'll learn something

Site Menu

  • Home
  • Recent Posts
  • Forum
    • Programming Languages
      • C++
    • Website Design & Content Management
      • Wordpress >> Drupal
  • Blogs
  • Topics
    • C++
    • Changing hosts - Dummies Guide
    • Wordpress >> Drupal
  • Download Centre
  • Contact us
Home


Image - OpenID

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password

Navigation

  • Recent posts

Topics

  • C++ (The Book)
  • Changing Hosts - a Dummies Guide
  • Wordpress to Drupal

Recent comments

  • Thanks..
    37 weeks 6 days ago
  • Hmmm,Interesting one,thx for
    39 weeks 10 hours ago
  • Buyer beware
    39 weeks 6 days ago
  • REPLY:Actual Processes Involved
    40 weeks 9 hours ago
  • Back to Ruby
    49 weeks 2 days ago
  • Links provided
    1 year 12 weeks ago
  • Module for wordpress to Drupal 6.x
    1 year 12 weeks ago
  • The wordpress plugin looks
    1 year 14 weeks ago
  • Good point..... You're
    1 year 14 weeks ago
  • Many thanks. If I'm going to
    1 year 14 weeks ago

New forum topics

  • Imported posts only visible to user1
  • What should the port number be
  • WordPress MU?
  • funny little bug in mac version
  • Error: Unable to Insert into Node_revisions table when converting from wordpress 2.6.0 to drupal 6.4
more

Sponsored links

Steve's Stuff
All about my running and from time to time other stuff

Improve Memory
All about memory techniques, excellent and relevant articles.

Other

To be used when none of the other keywords are not applicable. ie. This might be a topic about a new programming language Z++ which is not yet a 'Topic Item'. Select this and very soon, if this is a common topic an entry for 'Z++' will be created.

Dynamic Web Pages - Forced Redirect 301

Submitted by Steve on Thu, 3 Apr, 2008 - 21:23
  • CMS
  • Other
  • .htaccess
  • apache
  • RewriteCond
  • RewriteRule

I created this site as I'd outgrown my personal blogging site. My personal blog was created to keep track of my running training but as time went by I included other topics, such as Drupal and C++ programming stuff.

I was surprised by the amount of hits I was receiving and most were as a result of the technical stuff. As you can imagine my web pages were well and truly entrenched within the Google, Yahoo search engine system.

I had no choice, I had to create another site more suited to computer technical stuff and move away from the 'only' blogging regime.

Transferring the IT stuff from my old site to the new site was/is a manual process, there aren't that many IT related entries but I still wanted to keep them. I'm not bothering with the bulk of the comments.

After copying the web pages relating to the Wordpress to Drupal converter and copying the download page and associated download files, I was then left with, "how will the search engines find me". This is where the forced re-directs come in.

In my case I only wanted to redirect certain pages from my old site (http://superjacent.net/?q=node/nnn) to the corresponding page at this site (http://prime357.org/node/nnn). After many hours scouring the web I finally came across this thread which explained how this is all achieved.

Remember, I'm re-directing certain dynamic web pages from the old site (Drupal) to my new site (Drupal). Edit the .htaccess file at the Drupal root of the old site. Place these lines relatively early in the file or at least before other 'clean url' type RewriteRules commence.

# Forced re-directs - advice from http://drupal.org/node/38960#comment-621148
# 3 Apr 2008

# Download page - converter program
RewriteCond %{QUERY_STRING} ^q=node/509$
RewriteRule ^$ http://prime357.org/node/23? [R=301,L]

# Converter manual
RewriteCond %{QUERY_STRING} ^q=node/518$
RewriteRule ^$ http://prime357.org/node/1? [R=301,L]

The #'s are comment lines only.

I've displayed two RewriteCond and RewriteRule's. These effectively are 'hard-coded'. If we deal with the first one, all that happens is that if 'q=node/518' is the requested page then the following line re-directs the page to 'node/1' of the new site (this site).

The [R=301,L] merely tells the search engines that this is a permanent re-direct. Apparently, in time, the search engines will update their search database with the new information, as provided by our RewriteRule. The [L] merely means it's the last RewriteRule for the given condition.

Clear as mud.

  • Add new comment
  • Read more
  • 589 reads

Download Centre

Submitted by Steve on Wed, 2 Apr, 2008 - 21:14
  • Other
  • index

The download place, where everything else is.

Wordpress 2.2 to Drupal 5.x converter

Wordpress 2.5 to Drupal 5.x / 6.x converter

  • 8232 reads

 Subscribe in a reader

free hit counter


RoopleTheme