Getting a 404 error after a fresh AlgoSphere installation is almost always caused by Apache mod_rewrite not being enabled, or the .htaccess file not being applied correctly.

Root Cause

AlgoSphere uses URL rewriting to create clean URLs. If mod_rewrite is disabled, Apache cannot process these routes and returns a 404 error for every page except the root.

Solution 1 — Enable mod_rewrite in cPanel

  1. Log in to cPanel and navigate to Apache Handlers or ask your hosting provider to enable mod_rewrite.
  2. Ensure the following directive is set in Apache configuration: AllowOverride All

Solution 2 — Check the .htaccess File

AlgoSphere ships with an .htaccess file in its root directory. Some FTP clients hide dot files — verify the file was uploaded. It should contain:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

Solution 3 — NGINX Users

NGINX does not use .htaccess. Add rewrite rules to your NGINX site configuration:

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

Solution 4 — Incorrect Base URL

If mod_rewrite is working but you're still seeing 404s, open application/config/config.php and verify $config['base_url'] exactly matches your installation URL including the trailing slash.

Example

If installed at https://manage.algosphere.co.in, the base URL must be: https://manage.algosphere.co.in/