[英]Hosting Codeigniter site on GoDaddy with shared hosting
目錄結構( public_html
)
public html
htpasswds
application
.htacess
cgi-bin
system
user_guide
index.php
配置文件如下所示:
$config['base_url'] = 'http://www.example.com/index.php/';
$config['index_page'] = 'index.php?';
$config['uri_protocol'] = 'AUTO';
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
.htaccess
文件
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
route.php
$route['default_controller'] = 'welcome';
在application->controllers
我有兩個PHP文件, welcome
並about
在它們的方法。
以下是我正在生成的鏈接,它們是
<li><a href='./welcome'>Home</a>
<li><a href='./welcome/first'>first</a></li>
<li><a href='./welcome/second'>second</a></li>
<li><a href='./third'>Third</a></li>
<li><a href='./fourth>Four</a></li>
<li><a href='./five'>Five</a></li>
<li><a href='./six'>Six</a></li>
如果我手動輸入http://www.example.com/index.php/welcome/second
,則可以訪問該頁面。 但是我不知道如何生成相同的鏈接,以及如何擺脫URL中的index.php
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.