从CodeIgniter网址中删除index.php重定向到本地主机 [英] Removing index.php from CodeIgniter url redirects to localhost

查看:118
本文介绍了从CodeIgniter网址中删除index.php重定向到本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WampServer进行开发,并尝试从CodeIgniter网址中删除index.php。如我在ellislab网站中所见,将这些行添加到了.htaccess文件中:
https: //www.codeigniter.com/user_guide/general/urls.html

I'm developing with WampServer and tried to remove index.php from CodeIgniter urls. Added these lines to .htaccess file as I saw in ellislab website: https://www.codeigniter.com/user_guide/general/urls.html

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

这是我网站的根目录:
http:// localhost / job /

This is the root of my website: http://localhost/job/

但是现在当我想浏览 http:// localhost / job / seeker 我看到 http:// localhost /

But now when I want to navigate urls like http://localhost/job/seeker I see the Wampserver config page that is on http://localhost/.

我该怎么办?

谢谢

推荐答案

RewriteEngine on
RewriteBase /job
RewriteCond $1 !^(index\.php|images|table-images|robots\.txt|styles|js|uploads)
RewriteRule ^(.*)$ index.php/$1 [L]

并在application / config / config中设置.php

and set in application/config/config.php

$config['base_url'] = 'http://127.0.0.1:8000/job/';
$config['index_page'] = 'index.php';

这篇关于从CodeIgniter网址中删除index.php重定向到本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆