duanhuan5409 2016-09-17 19:42
浏览 115

codeigniter中的URL访问

I have create a project in codeigniter.I had set a base_url in config.php as http://testproject.com/test/

Now I can able access the application with that url (http://testproject.com/test/) and also I have able to login,but I cannot able to access the application with the URL www.testproject.com/test/ just here I have add a www before domain name.

I am getting the error as "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http".

In config.php I have set as a base url http://www.testproject.com/test/ now I have able to access the application with the url www.testproject.com/test/

But cannot able to access with the url "http://testproject.com/test/" getting the error as "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http".

I have set as uri_protocol 'AUTO';

$config['uri_protocol'] = 'AUTO';  

My .htaccess file looks like this

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|assets|images|css|js|robots\.txt)
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

Any one help me on this issue

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?