By default, pages on our site look like:


First, I need them to have ".html' on the end:


Second, I need any reference to ".print.html" (below) to redirect to .html:


This seems like an .htaccess thing to me, but a few things prompted me to write this question:

  1. I don't want to put these in .htaccess (that belongs to Drupal, correct?)
  2. I didn't have any success putting them inside my vhost file (following this post)
  3. I'm not sure if there is another recommended way to do this routing in drupal

Update: Here's a bit more info on my specific situation:

  • I'm only dealing with a single content type here - all 'items' are nodes of the same type.
  • Paths are currently generated via Pathauto
  • All 'items' are multi-lingual; pathauto creates urls from the title in each language
  • It would be good to know more information about the setup to give the best possible advice. For example, what is at those paths? Are they nodes or something else? Are the paths made using pathauto aliases or something else?
    – rooby
    Apr 2, 2015 at 6:46
  • @rooby Good point, I'll update my question a bit.
    – doub1ejack
    Apr 2, 2015 at 14:01

1 Answer 1


Your intuition is correct. It looks like a couple of simple htaccess rewrites:

  RewriteRule ^(.*)\\.print\\.html$ /$1 [NC,L,R=301]
  RewriteRule ^(.*)\\.html$ /$1 [NC,L,R=301]

To address your #1 concern, there's no problem altering .htaccess. It contains a few customizations that were designed to be altered depending on your needs (e.g. prepending "www." to your host name). It's required for some modules like boost.

The only caveat is you have to make sure to copy over customizations when you need to update core. If that's a problem there's the .htaccess module dedicated for keeping track of your custom rules.

  • Sure enough, the rewrite rules work fine. On my second try I got them working inside my vhosts file without trouble - not sure what the previous problem was there..
    – doub1ejack
    Apr 6, 2015 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.