Если вы установили свой virtualhost
& DocumentRoot
Все, что вам нужно сделать для вашего documentroot, это:
RewriteBase /
в вашем каталоге .htaccess
, проживающем вyour DocumentRoot
.
Для других папок вам потребуется настроить Alias
(Контекст: конфигурация сервера, виртуальный хост), директиву mod_alias
.
Пример:
Псевдоним / xyz / abc / def
И использовать директиву RewriteBase
в вашем каталоге .htaccess
Пример из: RewriteBase
:
# /abc/def/.htaccess -- per-dir config file for directory /abc/def
# Remember: /abc/def is the physical path of /xyz, i.e., the server
# has a 'Alias /xyz /abc/def' directive e.g.
#
RewriteEngine On
# let the server know that we were reached via /xyz and not
# via the physical path prefix /abc/def
RewriteBase /xyz
# now the rewriting rules
RewriteRule ^oldstuff\.html$ newstuff.html