Welcome! Log In Create A New Profile

Advanced

Alias css|img|js to assets

Posted by jamgood96 
Alias css|img|js to assets
February 27, 2013 07:16PM
I'm trying setup a location alias and am pulling my hair out. I'd like requests for example.com/(css|img|js) to alias to example.com/assets/(css|img|js), but for the life of me cannot get it working.

Here's what I have thus far:

location ~ ^/(css|js|img)/(.*)$ {
alias /srv/http/example.com/public_html/assets/$1/$2;
}

This seems to direct to the proper folder, but if says file not found when I try to access an actual file.

I'm missing something simple I feel, but not a clue what...
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready