的.htaccess文件夹虚拟文件夹重写文件夹、重写、htaccess

2023-09-02 00:44:54 作者:人心难测ヽゝ

有可能与Apache的RewriteEngine叙述做到以下几点,怎么办?

这是环境:

domain.com 有一个文件夹包含一个 index.html的页,htaccess的设置剥离文件,以便域。 COM /文件夹/ 打开 domain.com/folder/index.html

系统虚拟文件夹的用处

现在我需要做到的,是显示的 domain.com/folder / 的内容(的index.html),因为它来自 domain.com/virtualfolder / ,其中< STRONG> virtualfolder 不存在与该URL必须显示为 domain.com/virtualfolder /

我希望我写的这是可以理解的。

非常感谢你。

解决方案

 &LT; IfModule mod_rewrite.c&GT;
RewriteEngine叙述上
重写规则^虚拟文件夹/(.*)$文件夹/ $ 1 [QSA]
&LT; / IfModule&GT;
 

Is it possible with Apache's RewriteEngine to do the following, and how?

This is the environment:

domain.com has a folder that contains a index.html page, htaccess is set to strip files so domain.com/folder/ opens domain.com/folder/index.html

Now what i need to achieve is display domain.com/folder/ content (the index.html) as it comes from domain.com/virtualfolder/ where virtualfolder does not exist and the url has to show as domain.com/virtualfolder/

I hope what i wrote it is understandable.

Thank you very much

解决方案

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^virtual-folder/(.*)$ folder/$1 [QSA]
</IfModule>

 
精彩推荐
图片推荐