Symlink a path in component folder to a route

Hi,
I want to symlink a folder in component folder as a directory in root of my project for my sitemap,
I want to set that address for accesss the files created in that folder.
LIKE:
'app\components\sitemap\*' => 'http://mysite.com/sitemap/*'
Can I make any rule for routing this, or I must be do another method?

Hi @Parsa.Saei,

Creating a symbolic link in @webroot will do the job.
For example, assuming that your @webroot is located in /var/www/your_app/web, you can create a symlink named sitemap in /var/www/your_app/web pointing to @app/components/sitemap.

But, well, Iā€™m not very sure whether I get you right or not.
What contents do you have in sitemap directory? Html files or php files that are self-contained? If not, a simple symbolic link will not work as expected.

1 Like

@softark I wanted to find out any way for adding alias or pointing url to that folder,
But finally I did as your recommendation,
Thank you so much.