且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-02-14 21:58:50

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

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>