.htaccess folder to virtual-folder rewriting

纵饮孤独 提交于 2019-12-04 10:36:54
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^virtual-folder/(.*)$ folder/$1 [QSA]
</IfModule>

You need an alias:

Alias /virtualfolder /full_path_to/domain.com/folder

See http://httpd.apache.org/docs/2.2/mod/mod_alias.html for more details.

Alias is the most convenient way, but it is required to put the alias in the httpd.conf. If you rent some web space, the provider will usually only allow you to edit the .htaccess file, and it´s no possible to put an alias in there. In that case, you need to work with mod_rewrite. Just have the same problem right now when typing it.

However, if you rent some web space and you got Plesk 11.5 or 12.0 installed, there´s usually an option "virtual directory" (if not deactivated)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!