You are here: Home > Blog > Index


Wordle

September 5th, 2009

Share This

Marketing & Affiliates

September 5th, 2009


Share This

CakePHP on Zeus

February 28th, 2009

Recently I have been developing a site using CakePHP. Its a great framework, has been a good learning curve too. For a simple brochure site Cake would be overkill, but for a site with database information it would be great. Any way my post is not about Cake or how good/bad it is… I was merely sharing what I had to do to get Cake to work on hosted Zeus server.

Now most people would know that Zeus servers do not read .htaccess files so I had to overcome the rewrite issue.

I initially followed this post, but I required some query string goodness on my search pages. I then found this post for CodeIgniter another PHP framework, which uses similar traits to Cake.

Combining the two rewrite scripts I came up with one that would work for my Cake application using query strings.

  1.  
  2. RULE_0_START:
  3. # get the document root
  4. map path into SCRATCH:DOCROOT from /
  5. # initialize our variables
  6. set SCRATCH:ORIG_URL = %{URL}
  7. set SCRATCH:REQUEST_URI = %{URL}
  8.  
  9. # see if theres any queries in our URL
  10. match URL into $ with ^(.*)\?(.*)$
  11. if matched then
  12.  set SCRATCH:REQUEST_URI = $1
  13.   set SCRATCH:QUERY_STRING = $2
  14. endif
  15. RULE_0_END:
  16.  
  17. RULE_1_START:
  18. # prepare to search for file, rewrite if its not found
  19. set SCRATCH:DOCROOT . /app/webroot/%{SCRATCH:REQUEST_URI}
  20.  
  21. # check to see if the file requested is an actual file or
  22. # a directory with possibly an index.  don’t rewrite if so
  23. look for file at %{SCRATCH:DOCROOT}
  24. if not exists then
  25.  set URL = /app/webroot/index.php?url=%{SCRATCH:REQUEST_URI}
  26.   goto QSA_RULE_START
  27. else
  28.   set URL = /app/webroot/%{URL}
  29. endif
  30.  
  31. # if we made it here then its a file or dir and no rewrite
  32. goto END
  33. RULE_1_END:
  34.  
  35. QSA_RULE_START:
  36. # append the query string if there was one originally
  37. # the same as [QSA,L] for apache
  38. match SCRATCH:ORIG_URL into % with \?(.*)$
  39. if matched then
  40.  set URL = %{URL}&%{SCRATCH:QUERY_STRING}
  41. endif
  42. goto END
  43. QSA_RULE_END:
  44.  

Hope this helps…

Share This

Spread the good stuff

June 11th, 2008

Download Day - English

Share This

Installing MySQL on Vista

May 18th, 2008

Download the latest MySQL installer from the MySQL website. Once downloaded double click the installer.

mysql1.jpg

Click Here to view how i made money on Forex trading.

Read the rest of this entry »

Share This

Fiesty? Fawn?? Ubuntu???

April 5th, 2008

Well in an attempt to learn some more randomness… I finally fixed my other computer that was laying around. I downloaded a few ISO’s of Ubuntu. Firstly 7.04 in 64bit flavour, then 7.10 in 32bit flavour. 7.10/32 was giving me install issues so I reverted to 7.04 with a side of 32bits.  It worked fine. Amazing its running on a much slower machine… very little memory and appears to run smoother that vista! I also liked the idea of being able to command line installing software to create the webserver… made it very easy and was rather quick to install, configure and no hidden nasties. I reference this site… as it provided me with the necessary tools for a successful install of Apache, PHP and MYSQL on Ubuntu Feisty Fawn (7.04)

There are a few qwerks when a windows user moves into the Linux domain, but there is plenty of reference and help out there.

I will slowly move everything over to this linux choc top and play play play…

Share This