Drupal: .htaccess Access Deny
August 21, 2012 – 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.

First let’s speak about Order directive of .htaccess file of Apache server.
Description: …

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.


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

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.


Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: Redirecting Subdomain To Site Domain

Submitted by on March 16, 2012 – 9:31 amNo Comment

In this article, I would tell you a couple solutions of how you can set redirecting subdomain to the main site domain. One of the solutions will include using of an appropriate module.

Using of .htaccess file

Insert the following lines:

RewriteCond %{HTTP_HOST} ^www\.example\.com
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

to .htaccess (which is located in the site root) after this code:

<IfModule mod_rewrite.c>
RewriteEngine on

How it works:

  • http://www.example.com → http://example.com
  • http://www.example.com/* → http://example.com/*

Using of Toggle WWW module

If you have no access to .htaccess or web-server is not Apache, you can use a module that makes redirection of the kind:

http://www.example.com/some/deep/page → http://example.com/some/deep/page

Advantages of this method:

  • increasing LinkRank (search engines increase LinkRank of a new page when redirecting)
  • Old links still work

You can download & install the module from drupal.org.

Good luck!

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.