I want to rewrite any URL pointing to a specific directory on my server - but only if the url would lead to a 404 error.
Example:
- Code: Select all
http://example.dom/directory/existing.html -> no rewrite
http://example.dom/directory/not_existing.html - would lead into 404 error but should rewrite (because in /directory/) to http://example.dom/specialpage.html
http://example.dom/does_not_exist_too.html - no rewrite will lead into 404 error
I assume this may have to do something with look ahead variables (couldn't find valid documentation on this so far), but I don't have any idea to solve this.
Any help is very much appreciated. Thanks in advance