All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

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: How to prevent Publisher to add the prefix to URL when triggering a php page located at the root of

Status Resolved
Add-on / Version Publisher 2.8.3 build c996c438
Severity
EE Version 3.5.16

pixi

Jul 19, 2018

Hi Brian,

I wanted to know how to prevent Publisher to add the prefix to URL when triggering a php page located at the root of the website. Ignore setting can’t work here because it isn’t a channel, a template or a custom field. It is just a php script placed in a php file that have to be uploaded in root folder (in order to create symlink).

Because when I try to trigger the function by calling the PHP file via my browser it leads to 404 page because the add of language prefix in the URL.

I can’t disable the ‘add prefix’ option since I need it for the website.

#1

BoldMinded (Brian)

If you’re accessing a php file directly that means its not going through EE, thus its not going through Publisher. I have Publisher installed on a very large site that has a couple of php files in the root that are accessed directly and don’t have this problem. Are you sure there isn’t something happening with your htacess rules or something else that may be coming into play?

#2

pixi

There is the classic code to remove the index.php from EE urls.

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %&#123;THE_REQUEST&#125; ^GET.*index\.php [NC]
    RewriteCond %&#123;REQUEST_URI&#125; !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %&#123;REQUEST_FILENAME&#125; !-f
    RewriteCond %&#123;REQUEST_FILENAME&#125; !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]

</IfModule>

But the weird thing is that it adds the language prefix setted in publisher so I don’t understand how Publisher could not act here.

I made this test : I browse through the website and switch language. Then I tried again to go https:www.myurl.com/create_symlink_templates.php and it leads me to 404 page with the url https:www.myurl.com/nl/create_symlink_templates.php

#3

pixi

I mean http:// of course

#4

BoldMinded (Brian)

I just tested in my dev environment and basic php page requests work fine. This is my htaccess file.

RewriteEngine On
RewriteBase "/"

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

I’d suggest taking a look at caching, Apache/Nginx rewrite rules/config outside of htaccess, or even installing the site on another server to see if the issue still happens. I forget the config, but it is possible to force an include of a php file into every page request via Apache or PHP’s config, so there could be something like that happening.

I’m not sure what else I can suggest, but this just doesn’t sound like a Publisher issue. Requesting foo.php means its not bootstrapping EE, so no Publisher code is even run. Sounds like you need to dig into your server setup.

#5

pixi

Ok I’ll look at these and let you know. Thank you for your answers Brian.

Sorry if I come regularly with new issues but the more I build my project the more I find bugs etc… (and of course as publisher is the center BIG add-on of my project… :D )

Login to reply