Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess folder to virtual-folder rewriting

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

like image 835
Emanuele Avatar asked Nov 30 '22 22:11

Emanuele


1 Answers

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^virtual-folder/(.*)$ folder/$1 [QSA]
</IfModule>
like image 142
FrancescoMM Avatar answered Dec 04 '22 03:12

FrancescoMM