2010-10-01 138 views
0

我有一个HostGator和多个CI安装的共享主机方案。对于每次安装,我都能够成功地从URL中删除“index.php”,但在我的插件域中,我的CSS或JS或图像文件都没有正确加载。在共享HostGator服务器上安装多个CodeIgniter的问题

以下是我对主域国防部重写:

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

而对于我的插件域,我有这样的:

RewriteEngine On 
DirectoryIndex index.php 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

的插件域位于/的public_html/domain.com /。

我一直无法修改任何不给我一个内部服务器错误,500

任何想法?

回答

2

这是我设置它以避免由于重写导致的css无法加载。希望能帮助到你。

在称为资产的CI文档根中添加一个文件夹。这是系统文件夹所在的文件夹。将所有脚本,CSS,图像等放在资产文件夹中。

Folders: 
    >CI Root 
    >>assets 
    >>>CSS 
    >>>Scripts 
    >>>Images 

然后允许在.htaccess文件中的资产要求旁路的index.php:

RewriteEngine on 
    RewriteCond $1 !^(index\.php|images|assets|robots\.txt) 
    RewriteRule ^(.*)$ /index.php/$1 [L] 
+0

是不是正是我需要的,但你的回答让我在正确的道路上,我能修改重写,使其起作用。谢谢! – tchaymore 2010-10-05 22:07:40

+0

工作完美谢谢@JMC :) – 2012-11-10 16:44:17

相关问题