dongshan1959 2019-07-24 12:19
浏览 35
已采纳

在移动到不同的文件夹时,php中的codeigniter网站无法正常工作

i am new to codeigniter, i have a website which is working fine in the domain https://booktheparty.in

i have now moved the complete website to https://molugu.com/btp . have edited the following files and changed the database information also

config.php database.php

now the problem is, only home page is displaying in https://molugu.com/btp rest url are showing internal server error. for example this url https://molugu.com/btp/hyderabad

my htacces file

# HTTPS redirect
#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}/$1 [L]
#</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/pdf "access plus 1 year"
ExpiresByType text/x-javascript "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 year"
</IfModule>
## EXPIRES CACHING ##


<IfModule mod_headers.c>
  <FilesMatch ".(js|css|xml|gz|html)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>   

<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>


<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>

<ifmodule mod_expires.c>
<Filesmatch "\.(jpg|jpeg|png|html|gif|js|css|swf|ico|woff|mp3)$">
    ExpiresActive on
    ExpiresDefault "access plus 1 year"
</Filesmatch>
</ifmodule>


<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
</IfModule>

i am really new to this framework, can anyone please tell whats the problem

</div>
  • 写回答

1条回答 默认 最新

  • dqjo4340 2019-07-24 12:24
    关注

    I think you should modify the .htaccess file to also include the subfolder :

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^molugu.com$
    RewriteRule ^/?$ "http\:\/\/www\.molugu\.com\/" [R=301,L]
    RewriteRule ^$ btp/ [L]
    RewriteRule ^(.+)$ btp/index.php?/$1[L,QSA]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测