在加载Uniimart1609/S/page.php
到Uniimart1609/page.php
时需要隐藏一个文件夹
在linux中
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule Home_Page.php$ S/Home_Page.php
</IfModule>
被重定向http://Uniimart1609/Home_Page.php
这工作正常,但是当我重写htaccess时
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /S/$1.php [L,NC,QSA]
</IfModule>
获取在此服务器上找不到请求的URL /S/Home_Page.php。请求帮助
答案 0 :(得分:0)
你的规则如下:
<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>