У меня есть old.htm и new.htm в каталоге, и мне нужно загружать file.php каждый раз, когда кто-то обращается к old.htm, и загружать old.htm каждый раз, когда кто-то обращается к new.htm.
Вот мои нерабочие правила:
RewriteRule ^old\.htm$ file.php?%{REQUEST_URI} [L]
RewriteRule ^new\.htm$ old.htm [L]
При обращении к old.htm вызывается file.php. При обращении к new.htm к old.htm снова обращаются, переписывая его в file.php. Итак, в конце, доступ к new.php загружает file.php, но я хочу остановиться на old.htm.
Есть идеи?
Вот вывод RewriteLogLevel 3, если он помогает:
old.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/old.htm -> old.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^old\.htm$' to uri 'old.htm'
[rid#2006ee0/initial] (2) [per-dir D:/dev/www/estadao/arquivoweb/] rewrite old.htm -> file.php?/arquivoweb/old.htm
[rid#2006ee0/initial] (3) split uri=file.php?/arquivoweb/old.htm -> uri=file.php, args=/arquivoweb/old.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] add per-dir prefix: file.php -> D:/dev/www/estadao/arquivoweb/file.php
[rid#2006ee0/initial] (2) [per-dir D:/dev/www/estadao/arquivoweb/] strip document_root prefix: D:/dev/www/estadao/arquivoweb/file.php -> /arquivoweb/file.php
[rid#2006ee0/initial] (1) [per-dir D:/dev/www/estadao/arquivoweb/] internal redirect with /arquivoweb/file.php [INTERNAL REDIRECT]
[rid#200fb20/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/file.php -> file.php
[rid#200fb20/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^old\.htm$' to uri 'file.php'
[rid#200fb20/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/file.php -> file.php
[rid#200fb20/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^new\.htm$' to uri 'file.php'
[rid#200fb20/initial/redir#1] (1) [per-dir D:/dev/www/estadao/arquivoweb/] pass through D:/dev/www/estadao/arquivoweb/file.php
new.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/new.htm -> new.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^old\.htm$' to uri 'new.htm'
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/new.htm -> new.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^new\.htm$' to uri 'new.htm'
[rid#2006ee0/initial] (2) [per-dir D:/dev/www/estadao/arquivoweb/] rewrite new.htm -> old.htm
[rid#2006ee0/initial] (3) [per-dir D:/dev/www/estadao/arquivoweb/] add per-dir prefix: old.htm -> D:/dev/www/estadao/arquivoweb/old.htm
[rid#2006ee0/initial] (2) [per-dir D:/dev/www/estadao/arquivoweb/] strip document_root prefix: D:/dev/www/estadao/arquivoweb/old.htm -> /arquivoweb/old.htm
[rid#2006ee0/initial] (1) [per-dir D:/dev/www/estadao/arquivoweb/] internal redirect with /arquivoweb/old.htm [INTERNAL REDIRECT]
[rid#200fa90/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/old.htm -> old.htm
[rid#200fa90/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^old\.htm$' to uri 'old.htm'
[rid#200fa90/initial/redir#1] (2) [per-dir D:/dev/www/estadao/arquivoweb/] rewrite old.htm -> file.php?/arquivoweb/old.htm
[rid#200fa90/initial/redir#1] (3) split uri=file.php?/arquivoweb/old.htm -> uri=file.php, args=/arquivoweb/old.htm
[rid#200fa90/initial/redir#1] (3) [per-dir D:/dev/www/estadao/arquivoweb/] add per-dir prefix: file.php -> D:/dev/www/estadao/arquivoweb/file.php
[rid#200fa90/initial/redir#1] (2) [per-dir D:/dev/www/estadao/arquivoweb/] strip document_root prefix: D:/dev/www/estadao/arquivoweb/file.php -> /arquivoweb/file.php
[rid#200fa90/initial/redir#1] (1) [per-dir D:/dev/www/estadao/arquivoweb/] internal redirect with /arquivoweb/file.php [INTERNAL REDIRECT]
[rid#20e6c70/initial/redir#2] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/file.php -> file.php
[rid#20e6c70/initial/redir#2] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^old\.htm$' to uri 'file.php'
[rid#20e6c70/initial/redir#2] (3) [per-dir D:/dev/www/estadao/arquivoweb/] strip per-dir prefix: D:/dev/www/estadao/arquivoweb/file.php -> file.php
[rid#20e6c70/initial/redir#2] (3) [per-dir D:/dev/www/estadao/arquivoweb/] applying pattern '^new\.htm$' to uri 'file.php'
[rid#20e6c70/initial/redir#2] (1) [per-dir D:/dev/www/estadao/arquivoweb/] pass through D:/dev/www/estadao/arquivoweb/file.php