【问题标题】:codeigniter website in php not working when moved to different folderphp中的codeigniter网站在移动到不同的文件夹时不起作用
【发布时间】:2019-07-24 12:19:16
【问题描述】:

我是 codeigniter 的新手,我有一个网站在 https://booktheparty.in 域中运行良好

我现在已将整个网站移至 https://molugu.com/btp 。已编辑以下文件并更改了数据库信息

config.php 数据库.php

现在的问题是,https://molugu.com/btp 中只显示主页 rest url 显示内部服务器错误。例如这个网址https://molugu.com/btp/hyderabad

我的 htacces 文件

# 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>

我对这个框架真的很陌生,谁能告诉我有什么问题

【问题讨论】:

  • 检查基本网址

标签: php html codeigniter


【解决方案1】:

我认为您应该修改 .htaccess 文件以包含子文件夹:

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]

【讨论】:

  • 你好,我已经发布了我的 htacces 问题,你能告诉我如何更改它
猜你喜欢
  • 2023-03-19
  • 1970-01-01
  • 1970-01-01
  • 2012-08-30
  • 2011-09-12
  • 1970-01-01
  • 1970-01-01
  • 2017-09-29
  • 1970-01-01
相关资源
最近更新 更多