This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dkmattewother
dkmattewother

Hi! On my site i need to turn on instagram widget on main page. This widget have index.php file in "theme\assets\inwidget\" folder. October block all php files except index.php in .htaccess file

RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]

Can someone help me how to allow this files? watch a lot of themes on Stack Overflow, but not found the decision.

Last updated

skoobi
skoobi

Depending on whats its calling, can you call the file in your template {{ '/path/to/file' | theme }}, and then update any paths in the index.php. Or even better, you can download builder and build your own plugin. Theres some really good tutorials here on how to build a plugin.

miikelis+oran29818
miikelis+oran29818

You can exclude folders from the rule that prevents access to .php files like so:

RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteCond %{REQUEST_FILENAME} !/path/.*
RewriteRule !^index.php index.php [L,NC]

Another example for the 3rd line:

RewriteCond %{REQUEST_FILENAME} !/plugins/.*/public_php/.*

Alternatively, a single file:

RewriteCond %{REQUEST_FILENAME} !/public_php/helloworld.php

Make sure the folder is white listed above, too. Example:

RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources|public_php)/.*

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.