Access to files outside the document input area

I am writing a script to create a dynamic website, a website is created by loading external components.

DocumentRoot - this location is at / sites / website / public the components directory is located at / sites / website / components

i wannna to get to the data directory of each component depends on the requested URL.

eg:

URL:

http: //ibuildmywebsite/component-data/randomimage/demo/swan04090044_small.jpg

should get the file / sites / website / components / randomimage / data / demo / swan 04090044_small.jpg

how can i achieve this I would prefer it to be placed inside .htaccess (if any) instead of changing virtual host definitions.

Thanks!

+3
1

RewriteRule , ?

Alias /randomimage /sites/website/components/randomimage
RewriteRule ^component-(.*)/randomimage/(.*)$ /randomimage/$1/$2 [R,L]

( .htaccess)

, Symlinks :

Options +FollowSymLinks

components-*/randommimage/* /sites/website/components/randomimage/*/*/

+6

Source: https://habr.com/ru/post/1720513/


All Articles