Php 如何为公共html文件路径编写htaccess代码?

Php 如何为公共html文件路径编写htaccess代码?,php,codeigniter,Php,Codeigniter,当我将我的网站文件迁移到新服务器时,我收到错误“HTTP错误500” 我的旧服务器文件路径: public\u html>domain\u name>.htaccess和index.php 我的新服务器文件路径: 域名>公共html>.htaccess和index.php .htaccess文件代码: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f Re

当我将我的网站文件迁移到新服务器时,我收到错误“HTTP错误500”

我的旧服务器文件路径: public\u html>domain\u name>.htaccess和index.php

我的新服务器文件路径: 域名>公共html>.htaccess和index.php

.htaccess文件代码:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L,QSA]
错误消息:

2020-01-16 03:02:50 UTC[apache][core:info][pid 14130][client 202.187.242.213:53382]AH00128:文件不存在:/home/u820-7jd6fjqabudn/www/lifestartoday.com/public_html/assets/admin/js/popper.min.js.map


如何修改我的新服务器文件路径的.htaccess文件代码?

如下所示替换.htaccess文件代码

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
不需要在mod_rewrite中指定上述代码。 您只需使用以下命令打开“重写”模块:

$ sudo a2enmod rewrite
$ sudo systemctl restart apache2
另外,从popper.min.js文件中删除最后一行注释

//# sourceMappingURL=popper.min.js.map

该错误消息与您的
.htaccess
无关。我可以知道如何修复该错误吗?如果您遇到500个错误,您需要在日志中查找详细信息。对于源映射,您摘录的消息只是404错误。这与500错误无关。