Redis implementation for Windows

Install Redis Server:

Download the redis client and server from below URL (download the latest 64 bit or 32 as applicable):

https://github.com/rgl/redis/downloads

Now after installing it start the redis service from the windows services list (service name will be redis).

Install Redis Interface Library:

http://pecl-win.googlecode.com/files/php_redis-2.1.3-5.3-ts.dll (for php 5.3)

https://github.com/nicolasff/phpredis/downloads ( php_redis-2.1.3-5.2-vc6-ts-4350b2a.zip – for php 5.2)

From the above link download the dll file for redis and add it to extension directory of PHP.

Now update the php.ini file to point this new extension.

Implementation:

The implementation is written in PHP code, I have made the changes to

/base/meditab/med_db.php (Right now it has been done for MEM and MOS)

These changes make sure that if there is any update in any table the query for that table will be read from database else it will be from Redis cache.

Advertisements

Redirect http to secure https url for a specific domain name

We had a wildcard certificate *.example.com. We have other website too hosted on the same server like http://www.newexample.com.
Now we don’t have a certificate for http://www.newexample.com so, we want to redirect when someone types http://test.example.com to https://test.example.com.

So when a user types http://test.example.com they should be redirected to https://test.example.com. But http://www.newexample.com should not redirect to https://www.newexample.com instead of the fact that they both are hosted on same server and share same .htaccess file.

Here is the solution: (add this in your main root .htaccess file)
RewriteCond %{HTTPS} !on
RewriteCond %{SERVER_NAME} ^(.*.suiterx.com)
RewriteCond %{REQUEST_URI} !^(.*.wsdl) ##bypass wsdl file calls
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}