Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add baseurl option to serve everything from a specific base URL #51

arnar opened this Issue · 8 comments

4 participants


I will be using jekyll to generate my website, which is hosted under a specific URL prefix on my server ( ). Since I have nested folders with files, referencing other pages in common navigation elements is hard to do with relative urls. To let the Jekyll dev server reflect the url structure of the actual site, I added a new option called baseurl. Passing this option with a string such as "/arnar" tells the Jekyll webserver to serve _site from that mount-point.

The changes can be found in this branch


I can see how this might be useful for developing locally, but you actually serve your site with WEBrick? I think usually most people that host their own Jekyll sites just dump the generated files in their own folder and go from there. I'm willing to hear more about how you use this or others would use it if you're interested.


I use WEBrick to preview my site when I am making changes to it. When I am satisfied with the changes, I commit them to git and push them on to my server where they are served as static files from Apache.

Since my site is served from "/arnar" by Apache, I need to references this in various places, e.g. in CSS links (relative urls don't work since the master template might be used in various subdirectories). Having WEBrick behave exactly like Apache does with my configuration simply helps make the local previewing process smooth.


I could see Jekyll being very useful to college students building web pages hosted by their university. Most universities give limited web space to students, and this usually doesn't include the ability to install database-driven content management systems. These sites are also typically deployed in non-root locations, which requires some tweaking without the baseurl option described by Anar.


I'm in the situation described by akmassey. The web space I have is under my home directory on a server, and is mapped to server_url/username

If I put the path element I need in the permalink setting, the URLs come out right, but the files are not found by the server.

So I'm voting for this one. It would be great to allow for a sub-url's as the root of a jekyll site (or, if it can be done already, explain how to do it).


I have a fork that I use for myself with this feature, but I haven't pulled from the main repo in a while. I'll do so and send a pull request. In any case it is only an additional feature and doesn't change any existing behavior.


That's great arnar... Looking forward to seeing this happen.


Adding baseurl option. Closed by 4a8fc1f

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.