Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

arnar opened this Issue May 29, 2009 · 8 comments


None yet
5 participants

arnar commented May 29, 2009

I will be using jekyll to generate my website, which is hosted under a specific URL prefix on my server ( http://www.hvergi.net/arnar ). 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


qrush commented Jun 24, 2009

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.


arnar commented Jun 25, 2009

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.

akmassey commented Nov 9, 2009

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.

kastork commented Oct 13, 2010

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).


arnar commented Oct 13, 2010

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.

kastork commented Oct 17, 2010

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


arnar commented Oct 28, 2010


arnar commented Nov 18, 2010

Adding baseurl option. Closed by 4a8fc1f

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.