Вопрос

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?

Это было полезно?

Решение

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

Другие советы

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

location /demos/ {
  try_files $uri =404;
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top