Regex htaccess URL重写-在服务器上找不到请求的URL

Regex htaccess URL重写-在服务器上找不到请求的URL,regex,apache,.htaccess,mod-rewrite,Regex,Apache,.htaccess,Mod Rewrite,加载时需要隐藏一个文件夹,如Uniimart1609/S/page.php到Uniimart1609/page.php 在linux中 在此服务器上找不到获取请求的URL/S/Home_Page.php。求救 您的规则如下: <IfModule mod_rewrite.c> RewriteEngine on RewriteBase /Uniimart1609/ RewriteCond %{THE_REQUEST} /S/(\S*) [NC] RewriteRule ^ %1? [R

加载时需要隐藏一个文件夹,如
Uniimart1609/S/page.php
Uniimart1609/page.php

在linux中

在此服务器上找不到获取请求的URL/S/Home_Page.php。求救

您的规则如下:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /Uniimart1609/

RewriteCond %{THE_REQUEST} /S/(\S*) [NC]
RewriteRule ^ %1? [R=302,L,NE]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/S/$1\.php -f [NC]
RewriteRule ^([^./]+)/?$ S/$1.php [L]
</IfModule>

重新启动发动机
重写BASE/Uniimart1609/
RewriteCond%{THE_REQUEST}/S/(\S*)[NC]
是否重写规则^1?[R=302,长,东北]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
RewriteCond%{DOCUMENT_ROOT}/S/$1\.php-f[NC]
重写规则^([^./]+)/?$S/$1.php[L]

我尝试了上面的代码,但url没有从更改为加载时不工作,请参阅“帮助”。从index.php加载时,头被重定向到S/Home\u Page.php当您以
localhost/Uniimart1609/S/Home\u Page.php的形式输入URL时会发生什么情况?htaccess中还有更多的规则吗?页面正在加载,但url没有改变,这意味着localhost/Uniimart1609/S/Home\u page.php到localhost/Uniimart1609/Home\u page.php/S/文件夹仍然存在,如果我尝试像localhost/Uniimart1609/Home\u page.php那样加载,则表明您没有回复其他规则。这个htaccess中有更多的规则吗?还有,这个htaccess文件的位置是什么?
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /S/$1.php [L,NC,QSA]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /Uniimart1609/

RewriteCond %{THE_REQUEST} /S/(\S*) [NC]
RewriteRule ^ %1? [R=302,L,NE]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/S/$1\.php -f [NC]
RewriteRule ^([^./]+)/?$ S/$1.php [L]
</IfModule>