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 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误