我想访问我的网址没有index.php在CodeIgniter。这是我的Blog控制器
class Blog extends CI_Controller {
public function index() {
echo 'hello world';
}
public function about() {
echo 'about page';
}
}
现在我可以通过index访问http://localhost/codeigniter/index.php/Blog,但是我需要使用这个URL htt
我正在尝试重写URLS,以便/foo -> index.php。
index.php由codeigniter3驱动。bar.php是一个独立的php文件。
这是我的.htaccess中的一个片段:
//Test 1. Bar.php displayed. This works as exptected.
RewriteRule ^/?foo1/?$ /bar.php [QSA,L]
//Test 2. Redirects succesfully to index.php. Works as expected.
RewriteRule ^/?foo2/?$ /index.php [
如何从我的网址中删除"index.php“?
描述
使用CI构建一个简单的MySQL应用程序,我无法摆脱URL中的"index.php“标记:
localhost/CodeIgniter/index.php/Defult_Controller/index
.htaccess
application/.htaccess和application/cache/.htaccess
<IfModule mod_rewrite.c>
# !IMPORTANT! Set your RewriteBase here and don't forget trailing an
我在codeigniter中实现jquery.ajax时遇到了一个问题。我想要将控件发送到控制器的特定函数。我在javascript函数中设置url,如下所示
var url='<?php echo('First/index');?>';
var ajaxoptions={url:url,success:submit_ajax_response};
First是我的控制器,index是我想要将控件发送到的函数。当我单击调用它的事件时,将形成以下url
http://localhost/codeigniter/First/index
URL没有问题,但
在这里,我试图从我的codeigniter应用程序的URL中删除index.php。
为此,我编写了如下的.htaccess文件:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
# RewriteBase /projectname/
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and
如何在代码点火器中创建动态URL?
我遵循表,该表存储基本文章的详细信息:
1. ID
2. Article Title
3. Content
4. Tags
5. Status
6. Create Time
7. Update Time
8. Author ID
9. Status
现在我想知道如何创建动态URL,它包含Page ID和Article Title。
例如,http://www.domain.com/1/hello-codeigniter
在上面的示例URL中,我使用ID & Article Title生成URL。
检索文章内容的ID (当用户单击