One of our clients wanted to display a Flash intro on her Joomla website. She had the Flash intro but she didn’t know how to add it to the website – she wanted her visitors to first see the Flash intro and then get redirected to the actual Joomla website either automatically or by clicking on an “Enter Website” link in the flash intro itself.
Now, this seems to be a trivial task, all one needs is to create an index.html file, include the flash intro in that index.html, and redirect to index.php from within the Flash movie once the page is fully loaded. Right? Well, as usual, nothing is as easy as it seems…
This is because in many cases, the above will not work, or will cause problems with your website, here’s why:
- Your DirectoryIndex gives index.php the highest priority, which means that index.php will be the first file to get executed, and then index.* (* might htm, html, or any other file extension), which, in its turn, means that your index.html (and subsequently your flash intro) will never be served to your visistors.
In your Joomla website, you have your homepage set to http://www.yourjoomlawebsite.com/, which means that if the above works, everytime people click on the homepage link they will see the flash intro again (which can quickly become annoying and can reduce conversions).
Here’s how to handle the problems above:
- In order to ensure that index.html is the default index file for your Joomla website, you will need to add the following code to the beginning of your .htaccess file (this file is located in the root directory of your website):
DirectoryIndex index.html index.php
The above code will first run the index.html, which then calls the index.php from within the Flash movie. This way people will be able to see your flash intro.
As for the second problem, then you will need to make sure that the homepage link always points to index.php. You can do this by going to the Menu Item Manager for the Main Menu, and then changing the Menu Item Type of the Home’s menu item to External Link, and then setting the Link value of that External Link to index.php. This will force the website to go to the homepage of the Joomla website (and not index.html) when someone clicks on Home.
Another way for addressing the above problem is by using cookies. So, when someone accesses the website for the first time he will see the flash intro, but once he does that, the index.html file will set a cookie on his browser (let’s call it flash_played) that tells the browser that the flash introduction had already been played. Now, when the person goes to the homepage again, the index.html will see that the cookie flash_played is set to 1, so it will skip the flash intro and will redirect to the index.php file. Keep in mind that there are two downsides for this solution:
- It will not work for those who have disabled cookies on their browsers.
Visitors will only be able to see the flash intro once (because future hits on the index.html will automatically redirect them to the index.php without even displaying the flash intro). This problem can be solved by placing another Menu Item in your Main Menu of type External Link that will redirect to http://www.yourjoomlawebsite.com?replay_intro=1, and by modifying your index.html to check for the value of the replay_intro GET variable, if it’s 1 then the index.html file will replay the flash intro, regardless of whether the cookie flash_played was set to 1 or not. This means, however, that people need to click on a link to see the flash intro again.
We personally think that the above method is cumbersome and inefficient and it’s better (and simpler) to solve this problem by pointing the homepage of your website to index.php
We realize that doing the above can be a bit intimidating, especially if you don’t have the necessary programming experience to do it, and that’s why we’re here to help! Just contact us and we’ll be more than happy to do the above for you. By the way, our fees are very reasonable, so you don’t have to worry about that!