Configuring BaseURL for Codeigniter

I set my baseurl to:

 http://localhost/codeigniter/ 

in application/config/config.php file at the request of installation instructions .

I followed this tutorial . However, when I type url: http://localhost/codeigniter/index.php/pages/view , I get the following error:

Object not found!

The requested URL was not found on this server. If you entered the URL manually, check the spelling and try again.

If you think this is a server error, contact the webmaster.

Error 404

localhost 7/27/2012 11:14:39 PM Apache / 2.2.12 (Win32) DAV / 2 mod_ssl / 2.2.12 OpenSSL / 0.9.8k mod_autoindex_color PHP / 5.3.0 mod_perl / 2.0.4 Perl / v5.10.0

I found the following content in the .htaccess file on the path E:\WEB D\xampp\htdocs\CodeIgniter_2.1.2\application :

Refuse all

I am completely unfamiliar with the CodeIgniter framework. Can someone help me?

+6
source share
3 answers

Well, well, if someone wonders, the final solution to this was that the directories are incorrectly named. When creating a local server, it is important to place the contents of the files in the correct folder.

So, if you have http://localhost/codeigniter , then the directory should be configured as \path\to\webdirectory\root\codeigniter or in this case: E:\WEBD\xampp\htdocs\codeigniter

+6
source

try editing the .htaccess file as shown below and put the .htaccess file in the application root folder

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

Make sure your php errors are visible.

I had this problem when trying to set base_url for Code Igniter when I was working with localhost. I looked at the htaccess file, checked that mod_rewrite is enabled, tried to change base_url, but everything failed.

The solution was to ensure that the environment was configured to be developed in the main index.php file and to ensure that $ config ['log_threshold'] = 4; set in config.php.

After that, my php errors appeared. I forgot to switch the development environment for a new build of the website.

0
source

Source: https://habr.com/ru/post/921514/


All Articles