4

I can't access administrator's page; it returns 404 error not found. Although when I rename .htaccess to htaccess.txt, admin page works, but the whole site returns 404 error not found. When I rename it back to .htaccess, the website pages work, but not the admin page.

I am using Joomla 3 and I am using an extra login layer (from a plugin, but can't remember its name) for the Joomla administration panel.

Does anyone know what is causing this?

8
  • Do you have SEF URL's enabled in the Joomla Global Configuration?
    – Lodder
    Commented May 29, 2015 at 9:14
  • Remove that extra login layer and try again.
    – Plamen
    Commented May 29, 2015 at 9:30
  • @Lodder Yes I have SEF URL's enabled.
    – azhpo
    Commented May 29, 2015 at 10:15
  • What happens if you disable SEF URL's?
    – Lodder
    Commented May 29, 2015 at 10:20
  • @Lodder I've found the problem but I don't know how to fix it. I've downloaded Admin Tools Plugin -> akeebabackup.com/download/admin-tools.html I've downloaded it for an extra protection layer, though it seems when I disable this plugin, everything works fine. I think the problem is that this Admin Tools is using Non SEF URL's. Any idea how to make it work?
    – azhpo
    Commented May 29, 2015 at 10:32

6 Answers 6

4

If your admin area works widthout .htaccess its possible your joomla config has rewrite option enable. You can try edit your configuration.php file and change the status directly in configuration file:

$sef_rewrite = '0';
$sef = '0';
$sef_suffix = '0';
1
  • This worked for me but then it messes up my URL's
    – Gcamara14
    Commented Jan 14, 2020 at 1:11
2

I was having the same problem, and found a solution.

Disable the following items:

Cache

public $ caching = '';
public $ cache_handler = 'file'; # (replace memcache, per file)
public $ cachetime = '1600';

Memcache

public $ memcached_persist = '0'; # I was in '1'

Live Site

public $ live_site = ''; # (remove the full domain name)

Gzip

public $ gzip = '0'; # (disable, after running ... test the activation)

Sef

# (Disable as below, after running test enable)

public $ sef = '0';
public $ sef_rewrite = '0';
public $ sef_suffix = '0';

In case of error 404 for other pages, possibly the SEF is enabled.

  1. Check the .htacess (Rewrite enabled)
  2. Activate Rewrite

    $ cd / etc / apache2 / mods-available
    a2enmod rewrite
    

For SEF in NGINX with PHP-FPM Put in domain configuration (etc / nginx / sites-available / SITE.conf)

 server {
     listen ## IP ### or *: 80;
     server_name MYSITE.com www.MYSITE.com;
     root / home / MYSITE / public_html;
     index.php index.html index.htm; #### VERIFY THIS ORDER
     access_log /var/log/MYSITE.com_access_log;
     error_log /var/log/MYSITE.com_error_log;
     fastcgi_param GATEWAY_INTERFACE CGI / 1.1;
     fastcgi_param SERVER_SOFTWARE nginx;
     fastcgi_param QUERY_STRING $ query_string;
     fastcgi_param REQUEST_METHOD $ request_method;
     fastcgi_param CONTENT_TYPE $ content_type;
     fastcgi_param CONTENT_LENGTH $ content_length;
     fastcgi_param SCRIPT_FILENAME / home / MYSITE / public_html $                            
     fastcgi_script_name;
     fastcgi_param SCRIPT_NAME $ fastcgi_script_name;
     fastcgi_param REQUEST_URI $ request_uri;
     fastcgi_param DOCUMENT_URI $ document_uri;
     fastcgi_param DOCUMENT_ROOT / home / MYSITE / public_html;
     fastcgi_param SERVER_PROTOCOL $ server_protocol;
     fastcgi_param REMOTE_ADDR $ remote_addr;
     fastcgi_param REMOTE_PORT $ remote_port;
     fastcgi_param SERVER_ADDR $ server_addr;
     fastcgi_param SERVER_PORT $ server_port;
     fastcgi_param SERVER_NAME $ server_name;
     fastcgi_param HTTPS $ https;
     ##-> see that it is uncommented ## location ~ \ .php $ {
     ##-> uncommented ## try_files $ uri = 404;
     ## -> uncommented ## fastcgi_pass unix: /var/php-nginx/172882919829029351.sock/socket;
     location / {
         try_files $ uri /index.php;
     }
     location ~ \ .php $ {
         try_files $ uri = 404;
         fastcgi_split_path_info ^ (. + \. php) (/.+) $;
         fastcgi_pass localhost: 8001;
         fastcgi_read_timeout 6000;
         -> configuration for SSL HTS #add_header Strict-Transport-Security "max-age = 31536000; includeSubDomains" always;   
     }
     location ~ \ .user \ .ini $ {
         deny all;
     }
     listen ### IP or *: 443 ssl;
     ssl_certificate /home/mysite/ssl.cert;
     ssl_certificate_key /home/mysite/ssl.key;
     fastcgi_read_timeout 3000;
 }
1
  • I have tried to tighten up the formatting/tabbing. Please review my edit, and re-edit if I have damaged anything in your post. (Everyone hopes their posts are helpful, but "Hope this helps" is an unnecessary signoff, so I have removed it.) Commented Jul 5, 2019 at 9:56
0

Does that plugin by any chance add a token to access the admin? Like you need to add ?foo=bar to the URL to get access. Then it's working as intended.

You can disable that plugin by simply renaming the folder using FTP or by changing the state of it in the database (#__extension table).

0

Go to Admin Tools in the Joomla backend, then go to the SEO and Link Tools section.

In there, there will be 2 options:

  • Enable link migration
  • Convert all links to HTTPS when site is accessed over SSL

Try disabling both of these if they are enabled.

1
  • They were already disabled.
    – azhpo
    Commented May 29, 2015 at 10:41
0

The fix is in the file .htaccess

Delete the line:

RewriteRule .* index.php [L]

and save

go in your browser to: joomla/administrator and al work again!

2
  • 1
    Hi @Jhonny Barrios, can u explain why the above fixes the issue, it fixed the issue for me as well,but unsure the reason it fixed the issue
    – harshal
    Commented May 23, 2018 at 11:55
  • This worked for me but then it broke my interior pages
    – Gcamara14
    Commented Jan 13, 2020 at 23:23
0

In configuration.php, set public $live_site = ''; (only when working on localhost). I've been facing this problem myself repeatedly, for years literally, every time forgetting this old trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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