Re: rewrite engine shows text instead of executes script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Igor Cicimov <icicimov@xxxxxxxxx> [120130 16:10]:
> You need to tell apache you want it to handle the pyton files as scripts
> not as html/text files.
> 
> AddHandler cgi-script .cgi .pl .py
> 
> You (or someone else) have probably done that on linux but you are not
> aware or have forgotten about it.
  Yup. Here we have it:
  in 
  /etc/apache2/httpd.conf

  added the following:
  AddHandler cgi-script .py
  
  restarted apache 
  /usr/sbin/apachectl restart
  (That's for OSX/darwin/bsd flavor,
   differs on linux)

And now .htaccess looks like this:
# begin .htacces
AcceptPathInfo On
Options +ExecCGI
DirectoryIndex journalLoader.py 
RewriteEngine on
RewriteCond $1
!^(journalLoader\.py|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./journalLoader.py/$1 [L,QSA]
# end .htacces

Note that pathinfo is critical for me, as virtual
document path segments map to controllers, views and methods

Thanks for the tip! Any other constructive criticisms or suggestions
are welcome. 
cheers
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux