Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How To Save URLs Moving To Drupal

Submitted by on August 30, 2010 – 9:11 amNo Comment

When moving your site from one engine to another one, pages’ URLs are changed and you ma need to save oold URLs. First, there are links to these URLs from other sites, and search engines stores old URLs in index some time. This article will tell you how to save old URLs.

Solution
There are no old URLs anymore, but the can be used. We should create 301 redirect from old URL to a new one.

Alternatives
  • Redirect from old URL to new one in .htaccess file
  • Redirect from old URL to new one with the help of Pathauto and Global Redirect modules

Redirect from old URL to new one in .htaccess file

The simplest method:

add

RewriteCond %{REQUEST_URI} ^/old_url_1.html
RewriteCond %{REQUEST_URI} ^/old_url_2.html
RewriteCond %{REQUEST_URI} ^/old_url_3.html
RewriteCond %{REQUEST_URI} ^/old_url_N.html
RewriteRule ^(.*)$ http://site.ru$1 [R=301,L]

in .htaccess file (in the site root) after:

<IfModule mod_rewrite.c>
RewriteEngine on

Redirect from old URL to new one with the help of Pathauto and Global Redirect modules

The other method is to use Pathauto module with Global Redirect. Create one more synonym for a node in admin area. When calling this snonym, Global Redirect will redirect to main node alias.

In this case data is stored in database and Drupal would be loaded for redirect. So performance will go down. And if you wish to disable such redirect, it will take you more time.

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.