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

  • Got it solved This page here
    1 hour 8 min ago
  • Links working
    1 day 55 min ago
  • Thanks... I may be able to
    1 day 6 hours ago
  • 3306 by default
    1 day 16 hours ago
  • Is this the right place to
    1 day 17 hours ago
  • Figured
    3 weeks 6 days ago
  • I'm guessing at this stage
    3 weeks 6 days ago
  • WordPress MU?
    4 weeks 1 hour ago
  • Thanks
    10 weeks 1 day ago
  • I'm running the conversion
    11 weeks 4 days ago

New forum topics

  • 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
  • index.php?
more

Who's online

There are currently 0 users and 1 guest online.

Who's new

  • oODeathStormOo
  • leruffiant
  • Emtee
  • mnogodet
  • ZioMimmo

Dynamic Web Pages - Forced Redirect 301

  • View
  • Revisions
Submitted by Steve on Thu, 3 Apr, 2008 - 22: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.

  • Login or register to post comments
  • 209 reads

 Subscribe in a reader

free hit counter


RoopleTheme