Codeigniter The requested URL was not found on this server

In your Codeigniter project, you are getting the error “requested URL not found on this server error”, it means that the htaccess file is missing from the root directory of your Codeigniter application or misconfigured with xampp wampp ubuntu windows.

Here are two solutions to fix Codeigniter The requested URL was not found on this server error:

Solution 1: Verify .htaccess in public directory

Go to the public directory of the CodeIgniter app and verify if the .htaccess file exists in the public directory. Or if .htaccess file does not exist then you use solution 2.

If there is a .htaccess file present, then copy the Index.php and .htaccess file and paste both into the root directory of the CodeIgniter project.

And now go to /app/Config/ of the Codeigniter app and open the app.php file, after this, you will need to change baseURL in this file, something like this:

public $baseURL = 'http://localhost:8080';

To

public $baseURL = 'http://localhost/your_project_name/';

Solution 2: Create a new .htaccess file

In this solution, you need to create .htaccess file in the root directory, if it is not present in the CodingGitter app.

Once you have created the .htaccess file, add the following code to it; Something like this:

Options +FollowSymlinks -Indexes
RewriteEngine on

DirectoryIndex index.php
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Now, you can open your browser and check that your error is fixed.

Conclusion

That’s it; you have learned how to fix the requested url was not found on this server. in codeigniter xampp/wamp on ubuntu windows.

Recommended Codeigniter Posts

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *