【问题标题】:public folder on codeigniter and clean URLcodeigniter 上的公共文件夹和干净的 URL
【发布时间】:2013-08-12 02:32:37
【问题描述】:

带着保护/限制对文件夹codeigniter的访问的想法,我创建了一个公用文件夹。 主要思想是用户只能访问公用文件夹

<VirtualHost *:80>
     DocumentRoot "www / codeigniter / public"
     <Directory "www/codeigniter">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all Granted
     </ Directory>
</ VirtualHost>

这可行,但是当我尝试清理 url 时,index.php 不会出现错误 503。

我创建的.htaccess文件如下

<IfModule mod_rewrite.c>
 Options + FollowSymLinks
 RewriteEngine On
 RewriteCond% {REQUEST_FILENAME}!-D
 RewriteCond% {REQUEST_FILENAME}!-F
 RewriteRule ^ (. *) $ Index.php? / $ 1 [L]
</ IfModule>

我做错了什么或者我要做什么?

请原谅英语,谷歌翻译

【问题讨论】:

    标签: codeigniter clean-urls


    【解决方案1】:

    当我在我的一个 codeigniter 站点上复制它们时,您的 .htaccess 有一些奇怪的间距问题会破坏站点。我会尝试这些更改。

    <IfModule mod_rewrite.c>
     Options +FollowSymLinks
     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多