1

I'm having a problem between .htaccess and Drupal. Two sites (temporarily), one D7 in Drupal root and one D6 in subdirectory, both with the same content, some of which has to be shown in D6 for now.

It should work like this:

D7 link to a page that needs to use D6 site

x.com/page1 => x.com/d6_dir/page1

D6 link to a page that is in D7

x.com/d6_dir/page2 => x.com/page2

But what I end up with in the second case is

x.com/?q=page2

What I can't figure out is why Drupal is inserting the ?q=

The .htaccess file has redirects for each of the URLs that need to be forced to the subdirectory (D6). Preceding those lines is the following, that should remove the subdirectory from any request first, i.e., the resulting page request will be sent to the D7 site unless one of the D6 redirects apply

RedirectMatch 302 ^/d6_dir/.*$ /

have also tried

RedirectMatch 302 ^/d6_dir/.*$ http://x.com/

Background rationale:

  1. The site is being redesigned, and both the redesigned and original have 2 themes. Some pages are presented using one theme, some the other
  2. There is no way to know from the page path which theme it uses, so whether it needs the D6 or D7 site, so the links in the D7 site for page requests that need to redirect to d6_dir/page have 302 redirects, one for each page, at the end of the .htaccess file in the Drupal root. Works fine.
  3. The links for all pages in D6 start off as d6_dir/page, since that's the directory the site is in, but need to be redirected to drop the subfolder so that the page request is processed by the D7 site

Your Answer

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

Browse other questions tagged or ask your own question.