简体   繁体   English

localhost中的Codeigniter

[英]Codeigniter in localhost

I don't understand .htaccess yet. 我不了解.htaccess。 I have problem codeigniter application doesn't work in localhost my application is in this folder sturcture 我有问题,codeigniter应用程序在本地主机中不起作用,我的应用程序在此文件夹结构中

C:/xampp/htdocs/dev.application.pl/public_html/

My config.php is 我的config.php是

$config['base_url'] = 'http://localhost/dev.application.pl/';

And in folder dev.application.php/ i have .htaccess like this 在文件夹dev.application.php/我有这样的.htaccess文件

RewriteEngine On
RewriteBase /public_html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

But this doesn't work. 但这是行不通的。

Edit your hosts file and add 127.0.0.1 dev.application.pl 编辑您的主机文件并添加127.0.0.1 dev.application.pl

$config['base_url'] = ' http://dev.application.pl/ '; $ config ['base_url'] =' http://dev.application.pl/ ';

htaccess: htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Edit your .htaccess to this: 编辑您的.htaccess文件:

RewriteEngine On
RewriteBase /dev.application.pl/public_html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Hope it helps :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM