matthoiland
matthoiland

Reputation: 912

Allowing access to sub folder when running Ghost

I'm hoping to create a folder of stand-alone pages to use as demos that are referenced in my Ghost blog. For instance, if I'm writing a tutorial on development, I'd like to link to a completed demo of the finished product.

So if my Ghost blog is at http://blog.mysite.com, I'd like to have access to any stand alone files in http://blog.mysite.com/demos

Any ideas?

Upvotes: 0

Views: 527

Answers (2)

aludvigsen
aludvigsen

Reputation: 5981

To accomplish this you have to tell your webserver to point incoming traffic from /demos/ to another location than Ghost. You are not saying what webserver you are running your site on, so i'll give you two examples.

Say your demo files is located in the following directory /var/www/demos

Apache, mapping url to location
The Alias directive allows documents to be stored in the local filesystem other than under the DocumentRoot.

Alias  /demos/  /var/www/demos
<Directory /var/www/demos>
    Options All
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

Apache documentation

NGINX, mapping url to location
The alias defines a replacement for the specified location.

location /demos/ {
    alias /var/www/demos/;
}

NGINX documentation

Upvotes: 2

Mohammad AbuShady
Mohammad AbuShady

Reputation: 42789

I'd simply add a location block to exclude it from the catch all

location /demos/ {
  try_files $uri =404;
}

Upvotes: 1

Related Questions