[英]controller in sub-directory not accessible on hosting server in codeigniter application
我發現很難訪問托管服務器上子目錄中的控制器/功能,但是它在本地主機上運行良好,這是我的文件夾結構abc.com httpdocs cms .htaccess應用程序控制器頁面(其控制器不在子目錄下)admin (它的子目錄)用戶(無法訪問admin子目錄中的控制器),如果我通過url訪問它:abc.com/gms/admin/user/test它給了我Not Found在此服務器上找不到請求的文檔。 唯一可訪問的內容是abc.com/gms(它訪問頁面/索引控制器/功能)任何其他URL都給我提供了來自.htaccess的錯誤代碼
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /gms
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
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.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
來自routes.php的代碼:
$route['default_controller'] = "page";
$route['404_override'] = '';
config.php中的代碼
$config['base_url'] = '';
$config['index_page'] = '';
請提出建議,我真的希望事情完成,因為超過3天我無法在托管服務器上繼續進行,並且啟用了mod_rewrite。
在您的apache配置中。 httpd.conf
檢查根設置
允許全部覆蓋
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.