简体   繁体   English

无法在 php codeigniter 中设置初始页面

[英]Unable to set a initial page in php codeigniter

I'm new in php codeigniter, i need to modify a project but i cant set the base url it redirects me to an external url and i can't edit anything in the project. I'm new in php codeigniter, i need to modify a project but i cant set the base url it redirects me to an external url and i can't edit anything in the project.

for example if I enter the project path, it redirects me to 'https://test.com'例如,如果我输入项目路径,它会将我重定向到“https://test.com”

I set the base url in application/config to localhost.我将 application/config 中的基础 url 设置为 localhost。 But it does not work.但它不起作用。 this is my base url这是我的基地 url

$config['base_url'] = 'localhost/';

I have no idea what else could cause this problem I am very frustrated我不知道还有什么可能导致这个问题我很沮丧

Any idea or solution will be aprecciated.任何想法或解决方案将不胜感激。

Have a good day祝你有美好的一天

I'm guessing, when you try the below you always get the value https://test.com ?我猜,当你尝试下面你总是得到值https://test.com You can search the project folder for that value if it is being overriden somewhere.如果它在某处被覆盖,您可以在项目文件夹中搜索该值。

<?php echo base_url(); ?>

try check the .htaccess file under your codeigniter file project maybe your .htaccess set the url like this:尝试检查.htaccess文件项目下的 .htaccess 文件,也许您的.htaccess设置 Z572D4E421E5E6B9BC12ZE8A27 如下:

RewriteRule ^(.*)$ https://test.com/$1 [R,L]

change it to将其更改为

RewriteRule ^(.*)$ https://localhost/yourfilename/$1 [R,L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM