我有一个与HostGator和多个CI安装的共享主机计划。对于每个安装,我都能够成功地从URL中删除"index.php“,但在我的附加域名上,我的CSS、JS或图像文件都没有正确加载。
以下是我在主域上的mod重写:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]对于我的addon域名,我有这个:
RewriteEngine On
DirectoryIndex index.php
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]加载域位于/public_html/domain.com/。
我不能修改任何不会给我一个内部服务器错误500的东西。
有什么想法吗?
发布于 2010-10-01 10:08:15
这就是我如何设置它,以避免由于重写而不加载css。希望能有所帮助。
在配置项的文档根目录中添加一个名为assets的文件夹。它是您的系统文件夹所在的文件夹。将所有脚本、css、图像等放入assets文件夹中。
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]https://stackoverflow.com/questions/3835912
复制相似问题