Rewrite rule (no index.php) Blocking uploads

General questions relating to Joomla! 3.x. Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
snowrat
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Mon Dec 03, 2012 5:19 pm

Rewrite rule (no index.php) Blocking uploads

Postby snowrat » Thu Feb 08, 2018 1:03 pm

Hi all, just come across a strange problem, don't believe it was there before and have only noticed it since upgrade to 3.8.4.
When I use the rewrite rule to redirect away from /index.php to website root it blocks uploads in the front end editor. I have tried this with both JCE and the default Tiny MCE editor and get the same result with differing warnings. JCE says "Access to this resource is restricted" whilst Tiny MCE blocks with error - Unsafe file.

This is the code in the htaccess file, when removed everything works fine except it allows viewing of mydomain.com/index.php instead of just mydomain.com ...

RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
Last edited by toivo on Thu Feb 08, 2018 2:10 pm, edited 1 time in total.
Reason: mod note: moved, not related to 3.x Performance

Sean Clement
Joomla! Explorer
Joomla! Explorer
Posts: 339
Joined: Fri Oct 13, 2006 8:24 am
Contact:

Re: Rewrite rule (no index.php) Blocking uploads

Postby Sean Clement » Thu Feb 08, 2018 4:10 pm

Hi snowrat,

In order to remove the 'index.php' from your URLs, you should use the default Joomla! '.htaccess' and set 'Use URL Rewriting' to 'Yes' in 'Global Configuration'.

You may need to rename 'htaccess.txt' to '.htaccess' - using the Joomla! default .htaccess file is better than creating a new one.

Regards to TinyMCE - if using the Joomla! default .htaccess file doesn't resolve the issue, it's possible that your hosting provider has an anti virus program install on the server which is blocking the file from being uploaded.

Best regards
Sean Clement
Joomla! Security Experts - Joomla! Experts - Expert Joomla! Support
https://www.tjdixon.com/

snowrat
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Mon Dec 03, 2012 5:19 pm

Re: Rewrite rule (no index.php) Blocking uploads

Postby snowrat » Tue Feb 13, 2018 3:31 pm

Thank you Sean. Sorry for the delay I have been travelling so only just been able to come back.

I have followed your recommendation. It does indeed work like that but as I want to remove the index.php I add the code into the default Joomla htaccess ...

RewriteCond %{REQUEST_URI} !^.*/administrator/index\.php [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?) [NC]
RewriteRule ^ /%1 [R=301,L]

Unfortunately it does allow uploads but only if I remove the instruction in the htaccess for removing the index.php.

Perhaps there is a change that can be made to this code to remove the index.php ?

snowrat
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Mon Dec 03, 2012 5:19 pm

Re: Rewrite rule (no index.php) Blocking uploads

Postby snowrat » Tue Feb 13, 2018 3:39 pm

I am using https forced through the global configuration
(in case this makes a difference?)


Return to “General Questions/New to Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 28 guests