.htaccess maintenance

Again a while since the last post but honestly I have a lot of work to do, fortunately one of the projects I’m involved requires me to learn Python.. at last!

Anyway, one division of the company hired a third party to develop a web page. The provider finished the development and finally sent everything to us. It was a php webpage, it uses the Cake Framework and MySQL so everyone thought it was going to be very easy to release the webpage in the company’s server.

A few weeks before today we decided to order the site folder and create special boxes for mini sites and small projects, even though url may seem as if the folder is directly under the web server root, it isn’t. This is cool because it keeps things from being a mess and maintenance becomes pretty easy.

So, as I was saying, we got the scripts for both the site and the database. Database was easy, we just imported the sql file and voilá! done!

The problem rised when we got to the site’s scripts. We typed the url correctly and ¡nothing! so we were surprised, everything was working fine so it wasn’t possible for a single site not to work. We read the logs, enabled the debug and nothing raised. After a few days we decided that the provider should help us. So he happily agreed to bring his people to help me…. same result. Something strange was happening, finally the provider quit and told us that the development was working on their servers and they were happy with that…. sorry :s

I got mad because of this but my boss and I decided we should dig this in. After a few days we found the cause of the problem. When we ordered the web server folders we enabled an alias to a folder. Cake uses htaccess files to provide MVC functionality. When we enabled the alias folder we forgot to enable htaccess parse, duh! so we learned that each directory that will be included on a web server should have a conf line like this:

<Directory /absolute/path/to/alias/folder>
Options -Indexes Includes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all

We added the proper lines, modified the htaccess rewrite rules to support 2 different domains and now everything works.

We keep learning everyday 😀

Ad Vitam Paramus

Tags: ,

Comments are closed.