dongyun7897 2014-10-11 17:43
浏览 10
已采纳

Codeigniter安装已移动

I recently moved my codeigniter application from a subdomain to operate under my domain.

Basically I moved it from:

https://account.mywebsitehere.com

To:

https://mywebsitehere.com/account

Now when I try to access anything like /invoices it removes the /account from the url and results in a not found page. I have changed the base url in the config file but it is still resulting in this error.

Other than going through the entire application and changing every link to be /account/... How can I make the application work under the /account in the url?

My .htaccess file located at public_html/panda/.htaccess is as follows:

RewriteEngine on
RewriteCond $1    
!^(index\.php|robots\.txt|files\/images|files\/css|files\/js|files\/swf|files\/upload)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://mywebsitehere.com/panda/$1 [R,L]\
  • 写回答

3条回答 默认 最新

  • dongshu4755 2014-10-11 18:53
    关注

    just put that code in .htaccess file and try it

    RewriteEngine On
    RewriteBase /account/
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 javaweb登陆的网页为什么不能正确连接查询数据库
  • ¥15 数学建模数学建模需要
  • ¥15 已知许多点位,想通过高斯分布来随机选择固定数量的点位怎么改
  • ¥20 nao机器人语音识别问题
  • ¥15 怎么生成确定数目的泊松点过程
  • ¥15 layui数据表格多次重载的数据覆盖问题
  • ¥15 python点云生成mesh精度不够怎么办
  • ¥15 QT C++ 鼠标键盘通信
  • ¥15 改进Yolov8时添加的注意力模块在task.py里检测不到
  • ¥50 高维数据处理方法求指导