Reputation: 487
I would like to host a blog at a subfolder of my domain, which is covered by a django app. I'm most of the way there, but I need some help getting over the finish line, as it were.
Currently, if I go to domain.com
, the django app is served correctly. If I go to domain.com/blog/
, the blog is served correctly. However, if I go to domain.com/blog
(note the missing trailing slash), the urlconf returns a URL not found error.
I've tried a couple of things, including:
Alias
, Directory
, and WSGIScriptAlias
statements in my Apache configurationdomain.com/blog
condition and redirect to domain.com/blog/
(probably unsurprisingly causing an infinite loop of redirects)What are my next steps?
Here is the relevant part of my Apache conf:
Alias /blog/ /var/www/blog/
<Directory /var/www/blog/>
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Upvotes: 0
Views: 276
Reputation: 239380
I haven't used Apache in years, but try aliasing just /blog instead of /blog/. The problem currently is that Apache is not catching it, so it's being passed to Django. If that doesn't work, you might also try setting up a 301 redirect in your Apache conf to redirect to the slash version, thereby avoiding Django altogether.
Upvotes: 1