【问题标题】:CodeIgniter public_html remove slugCodeIgniter public_html 删除 slug
【发布时间】:2015-08-01 03:25:01
【问题描述】:

我在删除 url 中的 public_html slug 时遇到问题

看起来像这样

http://shirodailynews.esy.es/public_html/about

但我想成为这样的人

http://shirodailynews.esy.es/about

我当前在 public_html 中的 .htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

我的结构文件是这样的:

system
application
public_html
    css
    js
    img

我也这样配置了系统和应用路径

$system_path = '../system';
$application_folder = '../application';

当我访问主网址时,它没有显示 public_html

http://shirodailynews.esy.es/

但是当我访问另一个链接时,它会使用 public_html slug 重定向它。

http://shirodailynews.esy.es/public_html/about

如何删除 url 中的 public_html slug?提前致谢!

【问题讨论】:

    标签: apache codeigniter routing


    【解决方案1】:

    好像你的 webroot 不是 public_html,所以准确地说,你可能只需要将 index.php 和 .htaccess 文件放在它下面的目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-20
      • 1970-01-01
      • 2012-12-25
      • 2011-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多