Possibly stupid .htaccess/Dreamhost issue

37 views
Skip to first unread message

Charlie Martin

unread,
Sep 12, 2011, 10:49:15 PM9/12/11
to we...@googlegroups.com
I have no doubt this will turn out to be dumb, but I'm not very experienced with .htaccess files and I'm having a struggle.

I've got a pretty straight forward web.py application I'm building.  It works fine running the local webserver.  However, when I put it on Dreamhost, I can't access my static files.

Per the Dreamhost instructions, the .htaccess file is:

[cummiskey]$ cat .htaccess
Options +ExecCGI
AddHandler cgi-script .py
DirectoryIndex index.py/
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /public/
  RewriteCond %{REQUEST_URI} !^/favicon.ico$
  RewriteCond %{REQUEST_URI} !^/static/(.*)$
  RewriteCond %{REQUEST_URI} !^(/.*)+index.py/
  RewriteRule ^(.*)$ /index.py/$1 [PT]
</IfModule>

When I access the page, the access.log shows

67.165.250.93 - - [12/Sep/2011:19:40:38 -0700] "GET /index.py/ HTTP/1.1" 200 678 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20100101 Firefox/6.0.2" 
67.165.250.93 - - [12/Sep/2011:19:40:39 -0700] "GET /index.py/static/reset.css HTTP/1.1" 404 255 "http://www.microscopy.salveteomnis.com/index.py/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20100101 Firefox/6.0.2" 
67.165.250.93 - - [12/Sep/2011:19:40:40 -0700] "GET /index.py/static/common.css HTTP/1.1" 404 256 "http://www.microscopy.salveteomnis.com/index.py/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20100101 Firefox/6.0.2" 
67.165.250.93 - - [12/Sep/2011:19:40:40 -0700] "GET /index.py/static/microscope-large.jpg HTTP/1.1" 404 256 "http://www.microscopy.salveteomnis.com/index.py/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20100101 Firefox/6.0.2" 

Clearly (?) the URI isn't being rewritten correctly, but I've been messing with the .htaccess for a while with no luck.

Could some kind soul give me a hint?

Mark Erbaugh

unread,
Sep 13, 2011, 7:44:50 AM9/13/11
to we...@googlegroups.com

On Sep 12, 2011, at 10:49 PM, Charlie Martin wrote:

I have no doubt this will turn out to be dumb, but I'm not very experienced with .htaccess files and I'm having a struggle.

I've got a pretty straight forward web.py application I'm building.  It works fine running the local webserver.  However, when I put it on Dreamhost, I can't access my static files.

Per the Dreamhost instructions, the .htaccess file is:

[cummiskey]$ cat .htaccess
Options +ExecCGI
AddHandler cgi-script .py
DirectoryIndex index.py/
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /public/
  RewriteCond %{REQUEST_URI} !^/favicon.ico$
  RewriteCond %{REQUEST_URI} !^/static/(.*)$
  RewriteCond %{REQUEST_URI} !^(/.*)+index.py/
  RewriteRule ^(.*)$ /index.py/$1 [PT]
</IfModule>


I"ve got a small webpy app running on DreamHost that serves static files.  The only difference in my .htaccess is my RewriteBase line.

Mine is RewriteBase /

FWIW, I don't have a public folder. The website is on a subdomain (xxx.xxx.com) and the main.py, .htaccess files (and others) and static directory are in the main subdomain directory



Mark




Reply all
Reply to author
Forward
0 new messages