Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Force URL prefix setting not working as expected

Status Resolved
Add-on / Version Publisher
Severity Blocker
EE Version 24

submodal

Jul 29, 2013

Language segment always forced, even with “Force URL prefix” set to “No”  When going to a URL without the segment, we’re still being redirected to the URL including the segement - in this case /en.

Ideally our client has requested having the default language always excluded then set Force URL Prefix to “Yes” for non-default languages.  I know someone else has requested this feature so +1 on that.

#1

BoldMinded (Brian)

The force url prefix setting only forces the prefix the first time a page is loaded. So if you go to site.com with no valid language session/cookie it won’t redirect you if turned off. It will set the cookie and then re-write all the urls on the page to use the language code (if add url prefix setting is on). The only time force url prefix is actually used is in the event you visit the site with no language cookie, then it does a 302 redirect.

If you turn off both settings, then the language code will not be present, ever.

I’ll look into the feature request.

#2

BoldMinded (Brian)

Open models/publisher_setting.php and go to line 160 or so. You’ll see a line that says //Not working yet. Change the whole block after that to this:

case 'url_prefix':
case 'force_prefix':
    $setting = ee()->config->item('publisher_hide_prefix_on_default_language');

    if ($setting == 'y' AND ee()->publisher_lib->lang_id == ee()->publisher_lib->default_lang_id)
    {
        $return = FALSE;
    }
    else
    {
        $return = isset($this->settings[$key]) ? $this->settings[$key] : FALSE;
    }
break;

The only thing you’re doing is uncommenting that block and adding the case ‘force_prefix’: line. In your EE config.php file just add this:

$config['publisher_hide_prefix_on_default_language'] = "y";

Those changes should do it.

Login to reply