0

I've just enabled the included .htaccess file for Joomla 3.3.6 and now when I try to log on to the control panel it redirects to index.php in the root. By commenting it out I've narrowed it down to the line: RewriteRule .* index.php [L] (extracted from the SEF section below)

Commenting out doesn't feel like it should be the solution, is there an exception or something I should put in? My admin folder is already password protected via cPanel.

    ## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.
1

Don't remove RewriteRule .* index.php [L], that's an important part if you enable URL Rewriting.

You say you've password protected the admin folder, how exactly did you do that? It might be causing the problem, are you able to remove the protection and see if it works?

For security, I would rather recommend enabling two factor authorization in Joomla.

There are also a couple of other settings in your .htaccess file that might cause trouble:

# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

Another line that might cause errors is the RewriteBase (home page will work, all links will give a 404 Not found error):

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

This line is needed if your Joomla installation is located in a subfolder of your domain. Add the name of the subfolder after the / (e.g. RewriteBase /joomla). Note that this is not needed when Joomla inside a subfolder used as addon domain in cPanel.

You might also want to take a look at this post from the Joomla forum, there are several solutions that might/might not work.

  • Thanks for the reply, I tried a lot of the solutions you and the forum post mentioned with no luck. Removing the PW protection as you suggest cleared the issue and weirdly the issue stayed fixed after PW protection was re-enabled! I can't test this for sure but I suspect that it was related to me adding the .htaccess after I had protected the directory, which I wouldn't normally do. All said, probably the best point is the two factor authentication as you suggest! – Pete Q Dec 27 '14 at 5:05
  • Second Update. I was mistaken, problem still exists. – Pete Q Dec 27 '14 at 5:28
  • Have you added your PW protection to ROOT/.htaccess or ROOT/administrator/.htaccess? – johanpw Dec 27 '14 at 13:59
0

Firstly and most importantly, I do understand it is the current year, and resurrecting this thread is only because it may be helpful and I found no working answer to my problem. If I read correctly and the problem is the same as my own, a site in www.somesite.com/thisfolderisthehomedirectory when appended with '/administrator' returns a 404 to the root of www.somesite.com/ My joomla 3.5 installation left a htaccess.txt in my directory. renamed it to .htaccess that was it. May not work for you. beans.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.