[olug] Wordpress and Django

Dan Linder dan at linder.org
Sat Dec 31 12:46:12 CST 2016


I'm hosting my Linder.org web page at A Small Orange (
https://asmallorange.com/) on their small shared server plan.  I have my
main pages setup as a Wordpress site and I'm attempting to add a Django
framework so I can write some more advanced search routines (searching
email files for another site I host).

I *think* my problem is in the .htaccess for the ~/public_html/ folder.
Here is the initial .htaccess file:

# cat ~/public_html/.htaccess
AddType application/x-httpd-php56 .php

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


I'm following their steps in this article:
   https://kb.asmallorange.com/customer/portal/articles/
1603414-install-django-using-virtualenv

(I've updated their example code to to change "username" to my account name
and path, and the "pythonx.x" to the "python3.4" that I'm using.)

But problems start when I update the .htaccess with these lines:

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]


If I put the suggested .htaccess lines before the WordPress lines, Apache
complains of a generic "internal server error".

When I move them to the end of the .htaccess file, they don't appear to
have any effect.

I've placed the dispatch.fcgi in the *~/public_html/* as well as in a
*~/public_html/tst01/* folder and attempted to call both but neither works.

I tried adding this line to the WordPress section (before the first
"RewriteCond" WordPress added):

RewriteCond %{REQUEST_URI} !^/tst01/ [NC]


Thinking that says "No Change" to the URI when it begins with "/tst01/",
but it didn't seem to make a difference.

Any ideas on how I need to update the .htaccess files?

Thanks!
Dan

-- 
***************** ************* *********** ******* ***** *** **
"If you wish to make an apple pie from scratch,
  you must first invent the universe."
  -- Carl Sagan

"Quis custodiet ipsos custodes?"
    (Who can watch the watchmen?)
    -- from the Satires of Juvenal

"I do not fear computers, I fear the lack of them."
    -- Isaac Asimov (Author)
** *** ***** ******* *********** ************* *****************


More information about the OLUG mailing list