Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 在共享HostGator服务器上安装多个CodeIgniter时出现问题_Regex_Mod Rewrite_Codeigniter_Shared Hosting - Fatal编程技术网

Regex 在共享HostGator服务器上安装多个CodeIgniter时出现问题

Regex 在共享HostGator服务器上安装多个CodeIgniter时出现问题,regex,mod-rewrite,codeigniter,shared-hosting,Regex,Mod Rewrite,Codeigniter,Shared Hosting,我有一个与HostGator和多个CI安装共享的托管计划。对于每次安装,我都能够成功地从URL中删除“index.php”,但在我的加载域中,没有一个CSS、JS或图像文件正确加载 以下是我在主域上的mod rewrite功能: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] 对于我的插件域,我有: RewriteEngine On Di

我有一个与HostGator和多个CI安装共享的托管计划。对于每次安装,我都能够成功地从URL中删除“index.php”,但在我的加载域中,没有一个CSS、JS或图像文件正确加载

以下是我在主域上的mod rewrite功能:

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的内容


有什么想法吗

我就是这样设置的,以避免由于重写而无法加载css。希望能有帮助

在文档根目录中为CI添加名为assets的文件夹。它是系统文件夹所在的文件夹。将所有脚本、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]

这并不完全是我所需要的,但你的回答让我走上了正确的道路,我能够修改重写,使其正常工作。谢谢工作完美谢谢@JMC:)