gpt4 book ai didi

php - .htaccess 文件不适用于 hostgator

转载 作者:行者123 更新时间:2023-12-04 19:40:30 28 4
gpt4 key购买 nike

我已将我的 CRM 应用程序(开发的 PHP)从 hostgator VPS 迁移到托管程序,
我的应用程序文件夹结构是 crm\leadstracer1.1{其他 php 文件}。我在 crm 文件夹中保留了一个 .htaccess 文件,以避免 URL 上的“.php”扩展名,这在 hostgator 上运行良好。但是在迁移托管程序后它没有工作,我使用的是 CentOs 服务器,我尝试了以下链接的说明
Linux CentOS 7 - Configuration of httpd.conf file through .htaccess
Codeigniter URL rewriting .htaccess is not working on CentOS
但是什么都解决不了。
请查看我的 .htacess 文件的内容。

RewriteEngine On
RewriteRule ^$ leadstracer1.1/views/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ leadstracer1.1/views/$1.php
如果有人帮我重新调整这个就好了
谢谢

最佳答案

您是否正确配置了 httpd.conf 或 virtualhost conf 文件以允许使用 htacces 文件?
通常,您必须对其进行更改才能使其正常工作。
应该有一个名为 AllowOverride none 的指令必须配置为 All例如

关于php - .htaccess 文件不适用于 hostgator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64781825/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com