User login

mod_rewrite

Redirect URLs in in Apache server .htaccess file

Within the mod_rewrite directive....

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

...right below where Drupal's default .htaccess has the rewrite base option, we can add this:

  # Redirects from old site
  RewriteRule ^leadership.php$ /community/leadership [NC,R=301,L]

We can have as many rules like that as we want. It's not the fastest way to redirect but it's faster than making Drupal do it internally.

Rewrite rules really picky about a blank space in the bracket portion

Fun web fact for the day!

One little itty bitty space in the bracket part of the rewrite rule:

RewriteRule ^product/raptors/assimilate$ /product/raptors/assimilate/features [NC, R=301,L]

(instead of:
RewriteRule ^product/raptors/assimilate$ /product/raptors/assimilate/features [NC,R=301,L]
)

causes the entire web site to be replaced with:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Syndicate content