PHP中的Codeigniter网站在移动到其他文件夹时无法正常工作



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

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

配置.php数据库.php

现在的问题是,只有主页显示在 https://molugu.com/btp其余 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>

我真的是这个框架的新手,任何人都可以告诉问题所在吗

我认为您应该修改.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]

最新更新