Force SSL using Zend Framework and Apache

My main website, LS12Style.co.uk, has recently been undergoing a facelift and a complete change of direction. At the moment it is meant to act as a portfolio for myself, but since I have started a small Web Hosting business I thought I may as well put it to some good use.

I decided that the control panel that my clients will have access to will use SSL for all communications. Since I have never experienced use of SSL before, I decided to do a little experimentation. I use Apache for my webserver and the Zend Framework to base my applications on.

The Zend Framework is fantastic when it comes to developing and it even has Zend_Tool to get you started. Zend_Tool sets up a basic application structure and all the necessary files in place. It even creates a .htaccess file for you so it can route requests properly, giving you search engine friendly URL's.

Now because I had set up Apache with a popular web hosting control panel, I had to use it to set up the SSL for one of my virtual hosts (my client area for my new website). I googled "force website to use SSl in apache" and google seemed to find some very good answers. Although I did have a bit of trouble getting any of them to work with the already written .htaccess RewriteRules created by the Zend Framework. My first attempt, found here, looked something like this:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

After many tests with a faux website, it failed. So on my search continued, trawling through Google once again. After a (little, and I mean another 2 minutes) while I came across this solution:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.com/$1 [R,L]

I modified mine to contain an Apache environment variable, SERVER_NAME, in place of the domain.com, which seems to work.

And hey presto, it worked first time. My thanks go out to the author and the Apache Software Foundation.

Posted on Wednesday 23rd September, 2009 08:42

Comments (0) Add Comment


WTF? An Update?

Woah! Long time no update, eh? Well I think it's about time. I've been very busy at work lately and I've just not had time to be honest. I've been learning a lot of new things. Like how to use the Zend Framework, how to use Ubuntu through command line and use the Blueprint CSS framework.

I recently decided to take the plunge and set up a small business, hosting websites. I wanted to do this because I'm sick of all the shit you get, and have to go through, with regular website hosting companies. "250Mb space, 1Gb bandwidth - Only £4.99 a month!". Bullshit.

I had two choices:

1) Become a reseller for my current web host, or
2) Set up my own web hosting server.

Option 1 would have been the cheaper choice, but it didn't come without it's limitations. I could only host 10 websites before having to purchase another upgrade, meaning that earning potential was very low. The advantages to it were that everything would have already been in place.

Option 2 is more expensive, but gave me unlimited potential. Host unlimited domains, and give me the ability to upgrade software as I wished since I like to have shiny (read: latest) copies of all my software.

After a LOT of debating and searching, I decided to go with option 2. Yes it required a lot more work, but hey! It's all good. I was doing something that I enjoyed (I enjoy all things web related) and beneficial to my future career.

So, to show my love to the web world I have come up with the following hosting plan (yes PLAN, not PLANS):
Unlimited bandwidth usage
Unlimited disk usage
Unlimited MySQL Databases
Unlimited email accounts
Free .co.uk domain name for two years*
PHP5
MySQL 5

All this for:
Monthly: £2.50
Yearly: £25 (Save £5 off monthly price)
2 Yearly: £40 (Save £10 off yearly price, And £20 off monthly)
All payable by paypal.
30 day money back guarantee! No questions asked.

*Free domain name only with yearly signup or greater

So, if you feel like you've been messed around by your hosting company, please don't hesitate to email me at ashley@ls12style.co.uk

Posted on Tuesday 21st July, 2009 22:26

Comments (1) Add Comment


Free, No Obligation, Website Analysis

In light of my recent ability to host websites, I thought I would also offer a FREE service to all website owners.

I am pleased to offer a FREE, no obligation website analysis of your site. Delivered within 5 working days upon receipt of your confirmation email.

What does this analysis contain?
It is a report that looks in detail ad various aspects of your website. The following aspects will be looked into:
1) Standards Compliance - does your site comply to the latest web standards?
2) Accessibility - is your site accessible to people with disabilities?
3) Minor Search Engine Optimization - a few tips to help your website climb up in the google search results.
4) Website Optimization - A few more tips to help improve the load time and bandwidth usage of your website.

Why are you offering this?
I am offering this because I want to work towards a cleaner, easier to navigate web. I hate discrimination. Why should people who use a screen reader not be able to use your site?

So, if your interested, email me at ashley@ls12style.co.uk. Don't forget to include a link to your website.

Peace out!

Posted on Tuesday 14th July, 2009 14:09

Comments (0) Add Comment


Hello World!

Hello World!

Welcome to my brand new blogging site. Though, this site is much more than just a blog. It's a place where you will find useful things, such as discussions on various website design and development techniques, technologies and languages. You will also find the odd tutorial laying around too as and when I decide to write one.

The site is also a place to find galleries that contain various pictures from my many excursions. So far none are available, but I am still developing the site so they will become available soon enough.

Also as a side note, since I'm not looking for employment anymore, the projects I have completed relating to web design and development will also be found laying around somewhere.

Well, this is it for now. I'm going to get back to finishing the site.

Have fun!

Posted on Saturday 21st February, 2009 10:10

Comments (0) Add Comment


Web Application

I don't know about you, but I really like to keep track of where and how much money I spend. My iPhone makes this really easy as you can download many different and useful applications from the App Store.

Unfortunately I need to use two applications to suit my needs. I use one for budgeting and one for keeping an eye on how much money is in my bank account.

I use Spend (£0.59) for budgetting. This comes in very handy if you only want to spend certain amounts of money on certain things each week, two weeks or month. I have a few budgets like food and fuel. I like the UI on this one. It's very easy to add budgets and transactions. The only thing lacking is the ability to add a monthly income.

I use Balance (£free) to keep track of my bank balance. This is also very handy to have. This one has the ability to add a monthly income and recurring transactions, such as car insurance or phone bills. Again, this is easy to navigate and add transactions.

What I really need is a mixture of the two. So being the resourceful individual (ha!) I am, I decided to create my own application. Unfortunately I'm no C (or variant) developer, so I'm kinda stuck to creating stuff for the web. Which really isn't that bad, considering Apple use the Web-Kit framework for their Safari browser (which is used and adapted for the iPhone). This means that I can create a website that uses transitions, data loading techniques (thanks to AJAX!) and many other similar desktop like features.

Apple have a lot of really well documented guides and example codes that a free to use for Web App Developement. They make a whole bunch of very helpful comparisons on how to do things. Like the use of XML, compared to HTML and JSON when returning data from a database to a JavaScript function to display on the page. They showed that JSON uses the least bandwidth to transfer and therefore takes less time to load. I guess I've got some learning to do.

All that's left to say is, Watch This Space! You never know, I might submit it to Apple and make it commercial (free of course, since I'm rather partial to the Open Source Community). I need to make it before any of that happens though. So come back in about a year or so... or if your a regular reader of all six of my articles, come back sooner!

Posted on Saturday 27th December, 2008 21:15

Comments (0) Add Comment


Search