Archive

Archive for February, 2009

2 Domains with 1 Joomla Installation done right

February 25th, 2009

I have had 3 domain names for a while now representing 2 seperate business’s.  My problem has been I didnt have the time to write content for 2 seperate Joomla installations.  It was far easier to have 1 installation and set up some iframes for the 2 business domains.  The problem I discovered was that Google does like iframes and does not index them effectively. (it records the hidden address not that of the iframe, which makes sense)

So I decided to work out a way to have 2 domains (with seperate home pages accessing the 1 installation of Joomla.    Now I am guessing 2 installations of Joomla accessing the 1 database would work as well…but that wasnt what I wanted and has its own problems.

So to start with point the domains at the same host with the same document root.   This is done easily with cpanel.  Use add domain and just enter the doc root.  This sets up the virtual host.

Obviously you need to ensure your dns points at the same IP…I like using zoneedit.  Its free for less than 5 domains and for more well…its not that expensive.  My webhost did not allow DNS editting so because I use a unique mail server I needed a service like ZoneEdit.

Okay so your DNS is setup…and you have it pointing at the same Virtual host.

Now Joomla..you are going to need to edit 2 things

  1. .htaccess
  2. configuration.php

In .htaccess you need to turn modrewrite on.  Most people using SEO will have already done this.  at the bottom you need to add the following

Rewritecond %{HTTP_HOST} ^www.domain2.com$ [OR]
Rewritecond %{HTTP_HOST} ^domain2.com$
Rewriterule ^$ "index.php?content=eg,blog=76 ...." [R=301,L]

This basically takes anyone coming to you site via the 2nd domain and rewrites the request uri to the homepage of your 2nd site.  Obviously yuo should replace the index.php part with the correct path to your second home page….

So cool now when we access via domain2 we end up at the right page.  BUT all the links on the page will reference domain1 – not great for coherance.

So we need to make the site name dynamic and the site address as well, so the seo works.

So open the configuration.php in your favourite file editor (if your using cpanel use the “File Manager” select the file in the doc root and choose “Code Edit”).

Find the variable

$mosConfig_live_site
change the line to read
$mosConfig_live_site = 'http://'.$_SERVER['HTTP_HOST'];

Find the variable

$mosConfig_sitename
change the line to
IF($_SERVER['HTTP_HOST']=='www.domain2.com.au'){$mosConfig_sitename
="Title of Domain 2 Site";}else{$mosConfig_sitename ="Title of Domain
 1 Site";};

You can use a similar line to the above to vary any variable based on host.

Now change the file permissions of configuration.php to 444.  You can no longer use the Global config in the Joomla admin as it will change these settings back.

Check it all out you should be good to go.

Let me know if it works for you.

Share/Save/Bookmark

benjiC Website Design , , , , , , , , , ,

Partitioning a USB drive in Windows.

February 6th, 2009
Comments Off

At the outset I am going to state that using the standard windows (xp) removable drive drivers, you cannot partition a USB drive.  It just is not supported, you can reformat the drive to NTFS (for security) with a bit of tweaking, but you cant create multiple partitions.

So I found this simple trick to make windows see a USB as a fixed drive and allow multiple volumes and partition resizing.    You will need admin privileges for the system.

The first step in this process is to plug in the USB drive making sure it contains no critical files and just to be sure format it as Fat32 using the standard windows methodology.

Now determining the USB drives HID.  or Hardware ID, you are going to need this to tweak the install file for the new drivers.  To do this there are a number of methods. The easiest I have found is to open “Device Manager” .  Click the view menu and select “View by connection”. Now open the drop down lists below (the names may vary depending on youy system) until you find the PCI to USB Controllers (there may be more than one) open each in turn and until you see the name of the USB drive you have connected listed.  Below that should be “Generic Volume” Right click and select properties. Then select the details tab and in the “Property” drop down list select “Device Instance ID” – copy the displayed value to a notepad.

Alternatively if this does not work look in the registry under

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBSTOR

find your Drive and copy the key using everything after enum eg:

USBSTOR\DiskBUFFALO_USB_Flash_Disk__2.00

Cool you now have the device id.  Now you need to use it to edit the install (inf) file for the new driver.

I used the following driver “Hitachi Microdrive” Download it and save it to your desktop and extract the files to desktop.

One of the extracted files is called CFADISK.inf

Open it with your favorite text-editor I prefer Notepad++ found here.

Now find the section entitled [cfadisk_device]

Within that section you will find lines of text like this:

%Microdrive_devdesc% = cfadisk_install,IDE\DiskIBM-DSCM-11000__________________________SC2IC801

Basically what you need to do is comment out all (in this section) of them except one, the first one, place a “;” at the start of each line you wish to comment out.  In the first line replace anything after the “%Microdrive_devdesc% = cfadisk_install, “ with your Device Instance ID.  Now save the file.

Now you need to update the driver for your usb drive with your modified driver.  Go back to your Device manager and select the Generic Volume you found before (make sure its the right one) and chose “Update driver” from the driver tab.

On the first screen select “Not at this Time”

Second screen Select “Install from a Specific Location(advanced)

Third Select Dont search I will Choose the driver

Finally select “Have Disk”

Then Browse and chose the folder you saved the driver and install file you just updated in.

If you changed the ID correctly it should show you the a driver.

I have this working under XP but not under Windows 2003 I have yet to find a driver that 2003 will allow.

Keep in mind you need to install the driver on every system you wish to access anything above the first partition.  SO what I did is this

Created the first and largest partition as FAT32 I then created a Secure NTFS partition after this… This partition is not accessible unless I install the driver which I keep in the primary partition.  (copy it to desktop before you try and install it)

Good luck

Extra details here

http://www.pcreview.co.uk/forums/thread-2213125.php

Share/Save/Bookmark

benjiC System Management , ,