Mahlzeit,
Ich habe dafür natürlich 2 separate Rewrite-Regeln:
"Natürlich"? Davon stand aber nix in Deinem ersten Posting ... wieso erwartest Du von Deinen Lesern, dass sie einsatzbereite Glaskugeln neben dem Monitor stehen haben?
Die Fehlermeldung lautet: "File does not exist" und dann kommt der (absolute) Pfad zu der aufgerufenen Datei, also lokal z.B.: D:/html/tolle-projekte/interessant/toll-zu-merken
Klar. Die gibt's ja auch nicht.
Natürlich nicht. Aber wieso sucht er hier auf einmal mit dem absoluten Pfad? Würde er (der Server) weiterhin ab "/" suchen, würde er die Seite ja finden. Daher habe ich es mit absolutem Pfad rechts versucht, also http://www.domain.test/neu/seitexy.php?cat=2&id=99 und bekommen dann die "alte" URI im Browser angezeigt ...
Ein Blick in die Dokumentation könnte dabei helfen:
---8<---
Syntax: RewriteRule Pattern Substitution [flags]
[...]
The Substitution of a rewrite rule is the string that replaces the original URL-path that was matched by Pattern. The Substitution may be a:
file-system path
Designates the location on the file-system of the resource to be delivered to the client.
URL-path
A DocumentRoot-relative path to the resource to be served. Note that mod_rewrite tries to guess whether you have specified a file-system path or a URL-path by checking to see if the first segment of the path exists at the root of the file-system. For example, if you specify a Substitution string of /www/file.html, then this will be treated as a URL-path unless a directory named www exists at the root or your file-system, in which case it will be treated as a file-system path. If you wish other URL-mapping directives (such as Alias) to be applied to the resulting URL-path, use the [PT] flag as described below.
Absolute URL
If an absolute URL is specified, mod_rewrite checks to see whether the hostname matches the current host. If it does, the scheme and hostname are stripped out and the resulting path is treated as a URL-path. Otherwise, an external redirect is performed for the given URL. To force an external redirect back to the current host, see the [R] flag below.
- (dash)
A dash indicates that no substitution should be performed (the existing path is passed through untouched). This is used when a flag (see below) needs to be applied without changing the path.
In addition to plain text, the Substition string can include
1. back-references ($N) to the RewriteRule pattern
2. back-references (%N) to the last matched RewriteCond pattern
3. server-variables as in rule condition test-strings (%{VARNAME})
4. mapping-function calls (${mapname:key|default})
Back-references are identifiers of the form $N (N=0..9), which will be replaced by the contents of the Nth group of the matched Pattern. The server-variables are the same as for the TestString of a RewriteCond directive. The mapping-functions come from the RewriteMap directive and are explained there. These three types of variables are expanded in the order above.
As already mentioned, all rewrite rules are applied to the Substitution (in the order in which they are defined in the config file). The URL is completely replaced by the Substitution and the rewriting process continues until all rules have been applied, or it is explicitly terminated by a L flag.
--->8---
s.o. Liegt das ganze vielleicht etwa daran, dass ich in meiner Testumgebung mit virtuellem Host arbeite?! D.h. ich rufe tatsächlich http://www.domain.*test*/ auf, um zu meinem Projekt zu kommen.
Ich würde sagen: ja. Mach Dir evtl. nochmal die GENAUE Funktionsweise der RewriteEngine klar - helfen kann da das RewriteLog: dort steht ziemlich genau, was gemacht wird (auf LogLevel 9 - natürlich nicht produktiv nutzen!).
MfG,
EKKi
sh:( fo:| ch:? rl:( br:> n4:~ ie:% mo:} va:) de:] zu:) fl:{ ss:) ls:& js:|