hankknight
asked on
Rewrite to parent directory if not found
I want to rewrite all files that are not found in ./webAssets/ to the parrent directory.
If this is NOT found:
./webAssets/image/graphic. gif
Then I want to rewrite the URL as:
../webAssets/image/graphic .gif
If this is NOT found:
./webAssets/media/movie.mo v
Then I want to rewrite the URL as:
../webAssets/media/movie.m ov
If this is NOT found:
./webAssets/image/graphic.
Then I want to rewrite the URL as:
../webAssets/image/graphic
If this is NOT found:
./webAssets/media/movie.mo
Then I want to rewrite the URL as:
../webAssets/media/movie.m
ASKER
I will place the directives in an .htaccess file located here:
http://example.com/foo/bar/.htaccess
And I want
http://example.com/foo/bar/webAssets/images/pic.jpg
Rewritten here:
http://example.com/foo/webAssets/image/pic.jpg
http://example.com/foo/bar/.htaccess
And I want
http://example.com/foo/bar/webAssets/images/pic.jpg
Rewritten here:
http://example.com/foo/webAssets/image/pic.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I.e. to reach
"If this is NOT found:
./webAssets/image/graphic.
you're calling example.com/foo/bar/webAss
which should be rewritten to
example.com/foo/webAssets/
and the rewrite rules are e.g. in a example.com/foo/.htaccess?