Matthew Calabresi
Matthew Calabresi

Reputation: 487

Hosting a wordpress blog parallel with a django app

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:

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

Answers (1)

Chris Pratt
Chris Pratt

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

Related Questions