mod_rewrite:为所有网址添加“假文件夹”?

时间:2014-04-21 21:20:31

标签: regex apache mod-rewrite apache2

我如何在apache 2.4.9中为所有网址添加假文件夹?

示例:

http://localhost/index.html

更改为

http://localhost/folder/index.html

1 个答案:

答案 0 :(得分:1)

将此代码放入DOCUMENT_ROOT/.htaccess文件中:

RewriteEngine On

RewriteRule ^/?folder(/.*)?$ /$1 [L,NC]