codeigniter子域重定向问题

时间:2017-07-11 12:10:28

标签: php .htaccess codeigniter-3

您好我在lkn.ccomsys.net上托管了一个网站,并使用codeigniter框架编写。但是只有我的索引页面似乎打开,而没有内页打开。下面是我的.htaccess文件

<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /lkn
  RewriteCond $1 !^(index\.php|resources|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.


  ErrorDocument 404 /index.php
</IfModule>

我已经通过在重写规则+添加a中添加/之前的index.php检查了堆栈溢出给出的所有可能解决方案。在相同之前+将我的重写基础改为lkn.ccomsys.net。然而,这些解决方案似乎都不起作用。我能不能得到一些帮助。 谢谢。

1 个答案:

答案 0 :(得分:0)

使用此代码

RewriteEngine On
#RewriteBase /root_folder_name/
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
相关问题