为什么我的干净URL在另一个文件夹中不起作用?

问题描述 投票:1回答:1

我正在尝试获取用于SEO目的的干净URL。我以前从未做过,但我在页面文件夹中的简单文件中使用了它。

但是我的页面文件夹中还有另一个文件夹,称为文件夹b

我的凌乱的URL(在页面内文件夹):index.php?page =

来自文件夹b的混乱URL:index.php?page = folderb / file

我从页面文件夹中获得了干净的URL。但是从文件夹b中的页面我无法正常工作。

我已经尝试将另一个.htaccess文件添加到我的文件夹b文件夹中,并覆盖根.htaccess文件

我尝试在导航栏中添加域名/ folderb / nameFile。

我尝试过的所有事情都得到了404页

我的.htaccess文件

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?page=$1 [L,QSA]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?page=([^\s]+) [NC]
RewriteRule ^ %1? [R=301,L]

我希望从页面文件夹内的文件夹b中获得干净的URL。

php clean-urls
1个回答
0
投票

好,所以我又尝试了一次,但结果变得更糟我收到此错误消息

Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.

而且看来我不能拒绝这个。如果我切换到旧的.htaccess并更改header.php中的URL,它不会起作用。

我的其他页面正在工作,但是其中的所有页面domainName/home/Server/https/fastcgi/rid/54/26/59315426/htdocs/folderB/file

© www.soinside.com 2019 - 2024. All rights reserved.