httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mari Masuda <>
Subject [users@httpd] please help with mod_rewrite rules
Date Sat, 29 May 2010 19:20:11 GMT

I am moving a large website from a proprietary CMS to Drupal.  In the proprietary CMS, all
media files (images, pdfs, etc.) have URLs like or
 In my Drupal .htaccess I have created the following two mod_rewrite rules so that the old
URLs will continue to work and so we can continue using the scheme of
instead of using the Drupal location:

  # handle imagecache images
  RewriteCond %{HTTP_HOST} ^media\.(xxx|xxx-stage)\.org$
  RewriteCond %{QUERY_STRING} ^size=(x_small|small|medium_small|medium_large|large)$
  RewriteRule ^/?(.*) /imagecache/%1/$1? [L,NE]

  # handle requests for things at
  RewriteCond %{HTTP_HOST} ^media\.(xxx|xxx-stage)\.org$
  RewriteRule ^/?(.*)$1 [L]

I am not that experienced in regular expressions or mod_rewrite so I am actually not completely
sure how I got the above rewrite rules to work, but they do actually work.  (Beginner's luck,
I guess!)  In the actual RewriteRule of the second block (i.e., RewriteRule ^/?(.*)$1
[L]) I had to put the in order to get it to work.  My question is how
can I mask the rewritten URL so in the browser's address bar it just shows
instead of  To complicate matters,
I believe our host uses a link of some sort so that
is actually a link to /some/other/path/on/the/server.  When I was looking at the Apache documentation
it seemed like Alias or AliasMatch would be the thing to use to mask the URL but I could not
figure out how to get it to work.

Thank you for any tips!

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message