htaccess的不工作的codeigniter子域和放大器;目录中安装 [英] .htaccess not working on codeigniter subdomain & directory install

查看:97
本文介绍了htaccess的不工作的codeigniter子域和放大器;目录中安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要的目录,这也是一个子站点下安装CI。因此,我的基本URL看起来像 http://subdomain.domain.com/ci/

I am trying to install CI under a directory which is also on a subdomain. So my base url would look like http://subdomain.domain.com/ci/

下面的htaccess工作正常域的根,但不是在目录中,浏览器说,有重定向循环错误。

The following htaccess works fine on root of domain but not on directory, the browser says there is a redirect loop error.

下面是我的code:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^sub\.domain\.com/ci/$
RewriteRule ^(.*)$ http://sub.domain.com/ci/$1 [L,R=301]

RewriteCond $1 !^(index\.php|assets)
RewriteRule ^(.*)$ /index.php?/$1 [L]

我不是很熟练与mod-rewrite,任何帮助,将AP preciated!谢谢!

I am not very skilled with mod rewrite, any help would be appreciated! Thank you!

推荐答案

在你的/ CI目录中的htaccess的应该是如下:

Inside your /ci directory your htaccess should be as follows

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f # this means if the requested file name doesnt exist 
RewriteCond %{REQUEST_FILENAME} !-d # this means if the requested directory doesnt exist 
RewriteRule ^(.*)$ index.php [L]

根据这应该是足够您的上述评论

Based on your above comments that should be sufficient

这篇关于htaccess的不工作的codeigniter子域和放大器;目录中安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆