I added Themekey to an existing site, so that I can add an "m." mobile site within the site. My first step is to get requests for m.mysite.org to redirect to a dedicated new page that will be the mobile home page (m.mysite.org/mobilefront).
A request for www.mysite.org should not redirect, but a request for m.mysite.org should redirect.
The existing site is configured to have a page at /frontpage as the "Default front page" in Home » Administration » Configuration » System.
I can't figure out how to make a redirect rule that redirects the "front page" when the full path of the front page is NOT used in the request. I can get a working redirect for m.mysite.org/frontpage.
For m.mysite.org, I attempted this with two rules, the second nested under the first.
Rule 1: system:host = m.mysite.org
Rule 2 (nested): drupal:is_front_page = true
This works for m.mysite.org/frontpage, but not for m.mysite.org. Please direct me on the proper second rule(s) that will match the "site root" for m. but not www., which is the implied "front page": m.mysite.org
Thanks in advance,
Lee
Comments
Comment #1
mkalkbrennerdrupal:is_front_page should be the correct property.
Please turn on ThemeKey Debug to inspect the property values on the front page and report the results here.
Comment #2
lxcichano CreditAttribution: lxcichano commentedThanks for the response.
The Debug output does show the site root URL as:
However, the redirect rule does not fire. I tried changing the rules to just:
drupal:is_front_page = false
The redirect rule fires. To be clear, the redirect rule fires with 'false' as my rule value when the debug shows 'true'.
I tried changing the rule to:
drupal:is_front_page ! false
The redirect did not fire.
When I change it to:
drupal:is_front_page ! true
...The redirect rule fires.
Comment #3
mkalkbrennerThis sounds like a bug.
Can you test if a normal theme switching rule for drupal:is_front_page is working?
In this case we can narrow down the problem to the redirect sub-module.
Comment #4
lxcichano CreditAttribution: lxcichano commentedGood idea. I just tested it, and a theme switching rule for drupal:is_front_page works fine for me.
Comment #6
mkalkbrenner