我似乎做不到这一点--我很确定真正的问题是我只是让自己看不见它,所以我希望一双新鲜的眼睛能帮助我解决问题。
我不想让几个应用程序连接到我的系统上。此时,根文件夹中已经存在一个网站,但我不想在CI安装中使用一些微站点/powerformats。
我的mod_rewrite看起来像这样:
RewriteCond %{REQUEST_URI} ^/(powerformat1|powerformat2)/?$
RewriteRule ^(.*)$ powerformats/index.php/$1 [L] 不过,在尝试访问example.org/powerformat1 1或example.org/powerformat1 2时,如果获得正确的CI index.php,则会得到CI的404页面。
似乎无论我怎么重写规则,我要么得到404页面,要么什么都得不到。
有什么见解吗?
-编辑--
我认为我的问题是CI实际上得到了作为第一段传递的'powerformat1‘字符串。这就是我需要避免的。但这不能通过mod_rewrite解决吗?
发布于 2011-03-09 16:44:11
您可以尝试使用适当的查询字符串直接链接到该文件
RewriteRule ^(.*)$ /powerformats/index.php?somequery=$1 [L]
(您可能需要更改斜杠,如下所示)
或可能是这样的:
访问/powerformat1/可能会重写为
powerformats/index.php//powerformat1/
你可以试一试
RewriteRule ^/(.*)/$ /powerformats/index.php/$1 [L]
或者其他一些带有斜杠的变体:
RewriteRule ^/(.*)/$ /powerformats/index.php/$1/ [L]
发布于 2011-03-09 16:25:58
你想RewriteEngine On了吗?
https://stackoverflow.com/questions/5242834
复制相似问题