网页重定向到localhost [英] webpage redirects to localhost

查看:815
本文介绍了网页重定向到localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的web开发世界。我有一个网站托管。当我登录它应该带我到member_dashboard.php。它重定向到localhost上的此页面。如果我修改localhost路径,远程重定向会受到影响。我使用codeigniter作为框架。 base_url留空。我尝试设置基本URL与我的索引页的完整http路径仍然不能解决它。

I am new to the world of web development. I have a website hosted. When I login it should take me to "member_dashboard.php". It redirects to this page on localhost. If I modify the localhost path, the remote redirect gets affected. I am using codeigniter as the framework. "base_url" is left blank. I tried setting the base url with the full http path of my index page still cannot fix it.

$ config ['base_url'] = ';

推荐答案

执行此更改

config / routes.php

$route['default_controller'] = "";//default controller name
$route['404_override'] = '';

config / config.php p>

In config/config.php

$config['base_url'] = '';
$config['index_page'] = '';

config / autoload.php p>

In config/autoload.php

$autoload['helper'] = array('url');

.htaccess c $ c> application 文件夹)

In .htaccess (Place outside application folder)

 <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L] 
  </IfModule>

这篇关于网页重定向到localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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