问题描述
我似乎无法让我的路由才能正常工作。现在到我需要去 www.website.com/core
我想这是唯一的 website.com 达到我的主页code>来欲言又止。
I can't seem to get my routing to work correctly. Right now to reach my main page I need to go to www.website.com/core
I would like this to be only website.com
to get to the core.
我遇到的第二个问题是我精读不能够检索存储在资产文件夹中的CSS和其他文件。能否请你看看我的configs,并告诉我,我应该调整哪些部分组成?我甚至不介意动资产文件夹复制到服务器上的不同的地方,我真的很希望得到这个工作。
The second issue I am having is I con not being able to retrieve any css and other files stored in the assets folder. Could you please take a look at my configs and tell me which parts I should adjust? I don't even mind moving the assets folder to a different place on the server, I just really want to get this to work.
在层级访问CI如下:
(root)/www/application/OBS/controllers...
我的CSS,JS和其他资产都存储在
My css, js and other assets are stored in
(root)/www/assets/OBS/css/style.css... //example rout to css
在CI我试图用
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/OBS/css/core_css.css" />
链接的样式和资产以及
to link the styles and assets and
<a href="<?php echo base_url('detail/'$id) ?>">
从意见链接功能
to link to functions from views
我的htaccess的是这样的:
My htaccess looks like this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]
在CI的配置,我设置了以下内容:
In the CI's config I have set the following:
$config['base_url'] = 'website.com/core'; //core is used as home/main
$config['index_page'] = '';
终于在CI的index.php文件我已经设置:
And finally in the CI's index.php I have set:
$application_folder = 'application/OBS';
感谢大家的阅读,并提前为您的答复。
Thank you all for reading and in advance for your replies.
推荐答案
试试这个,
设置 BASE_URL
到 website.com
仅
//application/config/config.php
$config['base_url'] = 'website.com';
然后在路线
默认的控制器设置为内核
Then on routes
set the default controller to core
//application/config/routes.php
$route['default_controller'] = "core";
这篇关于你能帮助我建立了我的CI URI路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!