Keyword

Exposing the K2 image upload php file in htaccess

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
6 years 1 month ago #167280 by Kelsey Brookes
Hi guys,

I've got a few lines in my htaccess to lock down any access to php files unless they're explicitly allowed. It works great as an additional security measure and works in all instances (so far!) saving items with images.

Here's my htaccess:
## Disallow access to rogue PHP files throughout the site, unless they are explicitly allowed
RewriteCond %{REQUEST_FILENAME} (\.php)$
RewriteCond %{REQUEST_FILENAME} !(/home/user/public_html/index.php)$
RewriteCond %{REQUEST_FILENAME} !(/home/user/public_html/administrator/index.php)$
RewriteCond %{REQUEST_FILENAME} !(/home/user/public_html/administrator/components/com_joomlaupdate/restore.php)$
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule (.*\.php)$ - [F]

What do I need to add to that to allow items with images to save the image?

Regards,

Kelsey

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum