.htaccess 为什么我的页面从一个目录是不显示?

x6yk4ghg  于 6个月前  发布在  其他
关注(0)|答案(2)|浏览(64)

一个PHP页面在位于根目录下时可以正常显示-https://reverd.com/why-use-reverd-com,但在位于about目录下时不可见:https://reverd.com/about/why-use-reverd-com,而在about目录下的其他页面可以正常显示-https://reverd.com/about/ssl-security-什么是错误的?我应该纠正什么?
我在根目录下的.htaccess文件中有以下语句:

# Enable output compression
<FilesMatch "\.(php|html|txt|css|js|gz|xml)$">
    SetOutputFilter DEFLATE
</FilesMatch>

# Remove (.php)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

字符串

esyap4oy

esyap4oy1#

确保在.htaccess文件中打开RewriteEngine

Options -MultiViews
RewriteEngine On

字符串
试试看,让我们知道如果这改变了什么。

bqf10yzr

bqf10yzr2#

对不起,我的错:在PHP页面文件的开头,我有这样的请求//我们必须要求xxxxxx文件。require_once '/nnnnnn/xxxxx.php';
而路径必须是这样的(因为它在一个文件夹中,而不是在根目录中require_once '../nnnnnn/xxxxx.php.php';
[https://reverd.com/about/why-use-reverd-com][1] [1]:https://reverd.com/about/why-use-reverd-com

相关问题