0

Getting 404 page not found error on Server , Whereas its working fine on local machine

Below in my .htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

Below is base_url code in config.php

$root=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST'];
$root.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
$config['base_url'] = $root;
Sameer
  • 1
  • 1
  • 1
    we'll need a bit more context here. Your local/remote folder structure, error logs.. Is your project in a subfolder on local but in root on remote server, or vice versa? – Ergec Dec 28 '21 at 07:04

1 Answers1

0

base_url code / Dynamic URI shouldn't be in 'config.php' because its function to establish "base". Move it to 'index.php' of 'root' directory.

ThT
  • 1
  • 1