.htaccess-单个预定义文件的虚拟目录

.htaccess-单个预定义文件的虚拟目录,.htaccess,directory,.htaccess,Directory,.htaccess行如何从单个php文件创建虚拟目录 www.domain.de/file.php应转到www.domain.de/file/ 不是所有的php文件,在本例中只有一个预定义文件file.php 谢谢 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^file.php$ file/ [L] </IfModule> 重新启动发动机 重写基/ 重

.htaccess行如何从单个php文件创建虚拟目录

www.domain.de/file.php应转到www.domain.de/file/

不是所有的php文件,在本例中只有一个预定义文件file.php

谢谢


<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^file.php$ file/ [L] 
</IfModule>
重新启动发动机 重写基/ 重写规则^file.php$file/[L]
我就是这样解决的:

DirectoryIndex index.php
RewriteEngine on
RewriteRule ^file/ file.php [L]
Options -Indexes