Monthly Archives: January 2014

Enable Browsing Files from a Browser for a Directory

This is all you have to do in order to be able to view files in a directory from any browser. If you try to go to a folder on your server with a browser and get a Forbidden, 404 or 403 error then this is the solution you need. If you go to the folder in a browser and see a webpage instead of files, then you just need to rename the index.html or index.php file to some other name besides "index" because most servers are set up to show index.php or index.html by default if no page is named in the address bar. However if you have already made sure there is no index file in your folder and you still can't view files because it says Forbidden or some similar error, then do this:

Make sure there is no .htaccess file in the folder to start with. If there is, add the line below to that file instead of uploading a new file.

Otherwise, open up your favorite notebook app that you would use for coding and start a new file. Copy and Paste the following into an empty file:

Options +Indexes

Save the file as .htaccess being sure that it saved with the period before the name. Then upload the new .htaccess file to the directory

Setting up Pretty URLs in Joomla 1.5 and K2

This week, I decided to tackle a Joomla job. The client was using Joomla 1.5 and the K2 extention, so that is rather important for this article to make sense completely, but it is similar to so pretty URLs without K2.

Setting up Permalinks in Joomla 1.5 and K2

This tutorial if about how to create nice looking links to your Joomla pages or articles. Here is how. I did this with hidden menus because I didn't want to add my Menu items to the main menu, but you can choose to add yours to the main menu if you want to see them in the navigation bar of your site.

First, create a directory for your path if you want one as I did because I wanted a link like http://www.example.com/services/php for various services such as PHP, JavaScript, CSS etc that I offer. Here are the steps to accomplish this:

  1. go to the Joomla admin and hover over the "menus" button in the main admin menu. Then select the menu item you want to add your menu to or select menu manager to create a new one.
  2. For the "Menu Item Type" select "Item" to create a menu item linking directly to an item in K2.
  3. In the resulting form, enter a title that will allow you to recognize the function of this menu item. I made a menu for service links, so I named my menu item, "Service Links".
  4. In the "Alias" field you put what you want to be in the url as the directory name part in the path to your page. So my page was called "PHP" and my goal was to make a link that looks like "http://www.example.com/services/php", so I entered "services" as the Alias.
  5. Skip over the "Link" field as it will fill out itself and go to the "Display In" field and select the menu item you want your link to appear under or pick one that is not shown publicly if you don't want to put your link in the actual navigation bar of the site.
  6. Go to the "Parent Item" field and select the item you want preceding the link. At this point, you will probably just have the "Top" option, which is perfect for what we are doing. Leave "Top" selected. Leave the rest of the defaults set in the left column of the page.
  7. In the right column, at the top, where it says "Parameters (Basic)" go to the "" field and select any item for this field as it is not important since we are creating a dummy item at this point just to get the directory parameter of our URL. CLick to save your menu.

Second, create a menu item for each page in "services" so here is how I did my PHP services page:

  1. Go back to the main admin navigation menu and hover over "Menus" again and this time, select the menu name you choose to put your menu under in the steps above.  You will see the menu item you created first, which was "Service Links" in my case, on the resulting page.
  2. Click on the big green "New" button at the top of the page to add a new Menu item. This time we are going to make a submenu of the "Service Links". Remember that service links has an alias of services to create the directory part as explained above so now we create the php part which is effectively the page name.
  3. Under "Select Menu Type", select "K2" then "Item".
  4. in the resulting page, enter a title that is the same as your article or page title, so I entered "PHP" as it is a page about my PHP services.
  5. Next, in the "Alias" field, I entered "php", all lowecase for a search engine friendly URL.
  6. In the "Display In" field, I select the same menu item I selected when creating the first part of the link way above at the top of this page.
  7. Then, I select "Service Links" as the parent menu so it will have the services/php effect I want on my link.
  8. That's it for settings in the left side of the page, now go to the right column at the top of the page and by where it says "Parameters(Basic)", select the actual article/page name you would have created before this tutorial(or create one real quick if you have not done so already). Then click the save icon at the top of the page to save your new link. I now have a link to services/php that is nice and search engine friendly!

I know it's a lot harder to do this in Joomla and much easier to do in WordPress, so I remain a larger fan of WordPress still!