1

I am moving content from an existing custom built CMS into Drupal 7. There is a host of mod_rewrite rules in place. These rules expand path names in the URL. For example, the rule below effectively expands

RewriteRule ^abc/?(.*)$ /alpha/beta/confusion/$1 [L,R]

Ideally we'd like put these rules inside of /etc/httpd/conf.d/old_redirects.conf. However, the clean URL rules are in .htaccess and are processed first.

Can I remove dependence on .htaccess and move these rules to /etc/httpd/conf/httpd.conf thereby allowing me to import the old_redirects.conf into the httpd.conf file before the Clean URL set of rewrites executes?

(I've referenced the following question How do I use .htaccess to trigger mod_rewrites before D7's Clean URLs take over? and Drupal 7 .htaccess redirects; and while good, they don't quite cover this from the perspective the a need.)

1

Moving effort to this question and answer Drupal 7 rewrite not using .htaccess. THis is what I'm trying to do anyhow is eliminate the .htaccess.

However, I discovered a module called htaccess

Htaccess is a module which autogenerates a Drupal root htaccess file based on your settings.

Drupal tries to provide a one size fits all htaccess for Apache webservers, but this goal is increasingly difficult. This module allows the webmaster to set specific options.

Added benefits is that for every drupal core update (in which drupal overwrites htaccess), I just re-deploy my set of rules which this module appends to the active .htaccess file. Additionally, my customization to htaccess are in the database and safe in scheduled backups in from Backup Migrate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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