2014-02-26 33 views
0

我开发了一个使用codeigniter的网站;实际上它可以在本地主机上运行也可以在http://site-name/controller for example.Codeigniter,在此服务器上找不到请求的文档

但是,当我将域名更改为domain.com/site-name/controller。我有未找到页面,因为在此服务器上找不到请求的文档。

htaccess文件

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

是在'application/config/config.php'中正确设置的$ config ['base_url']'? – CIRCLE

+0

它是空的。$ config ['base_url'] \t =''; – Doksh

+0

你应该把你的新域名像'$ config ['base_url'] \t ='http://domain.com/site-name/';'它必须指向你的整个应用程序的根目录 – CIRCLE

回答

0

你需要更新你的重写:

RewriteRule ^(.*)$ /site-name/index.php/$1 [L,QSA] 

这样你site-name文件夹包含在重写,否则你重写将查找的根文件夹域名为index.php

相关问题