Modify the Default Homepage for your Domain

Share tips and tricks with the AOM user community.
associate-o-matic
Admin
Admin
Posts: 1879
Joined: Fri Oct 01, 2004 10:40 pm
Contact:

Modify the Default Homepage for your Domain

Post by associate-o-matic » Tue Mar 22, 2005 10:02 pm

Under normal circumstances, when someone types in your domain name, for example, http://www.yourdomain.com, the default page that it will go to is the "index.html" file found in your main public directory.

But what if you want to customize which page/script is the default for your domain? This becomes very useful for those sites that want to point to the shop.php file that Associate-O-Matic uses or maybe a sub section inside your store.

So how do you do it?

Here are a couple ways to accomplish this...

1. Add a directive to your http.conf within the VirtualHost section related to your domain.

This directive would look something like this:
DirectoryIndex shop.php

Or if you wanted to point to some subcategory within your store:
DirectoryIndex shop.php?mode=Electronics&node=1203558

You'll need to restart your server once the http.conf change is made.

2. You can also add a similar directive to a .htaccess file and place it in your main public directory. This too will accomplish the same thing.

If anyone has any other thoughts/ideas on this particular topic please reply.

Justin
Last edited by associate-o-matic on Tue May 09, 2006 5:18 pm, edited 1 time in total.
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

FirstAmendment
Experience Level 2
Experience Level 2
Posts: 95
Joined: Fri Jan 21, 2005 3:25 pm
Location: Palm Springs, CA USA
Contact:

Post by FirstAmendment » Wed Mar 23, 2005 7:58 pm

The method you describe is standards compliant and in keeping with web authoring best practices.

There is another quick and dirty way this can be done using a meta tag in the head section of an otherwise blank page.

Between <head> and </head> a line of code that said
<meta http-equiv=Refresh content="0;url=shop.php">

would cause a redirect to the shop.php page after a zero second delay. This file could be saved in the web server document root folder, usually public_html, with a name like index.html.

Some search engines don't much care for redirect pages, but it will work with every web browser I've ever tried.
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

bloodwrath
Experience Level 1
Experience Level 1
Posts: 38
Joined: Tue Apr 19, 2005 8:42 am
Location: Canada
Contact:

Post by bloodwrath » Thu Apr 21, 2005 4:12 pm

You could also do this

This is the main PHP script that powers Associate-O-Matic. You can rename this file to whatever you'd like so long as it ends in ".php" (e.g index.php, store.php, etc...)

NOTE: If you rename the file, you must also edit the non-encrypted portion of the file where it says $codelock_file="shop.php" to whatever the new name is.

i.e. http://www.yoursite.com/shop.php

so i renamed it to index.php
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

LindaBell009
Experience Level 1
Experience Level 1
Posts: 27
Joined: Fri Sep 02, 2005 12:02 pm
Contact:

What?

Post by LindaBell009 » Fri Sep 02, 2005 8:58 pm

This sounds wonderful!

Now, can you put it in steps that we non programmers can understand? Please?

Linda, the new gal on the "block"
LindaBell009@yahoo.com

Telejoke
Experience Level 3
Experience Level 3
Posts: 116
Joined: Tue Apr 26, 2005 10:01 pm

Post by Telejoke » Mon Sep 05, 2005 8:38 pm

I've had to do some redirect tricks on my servers, but being lazy, I haven't bothered with the .htaccess file and don't have access to the parent server's conf file.

Soooo. I used cPanel X's rediredt feature and tell it what I want done. It creates the appropriate files, and the only thing I can mess up is name of the file or subdomain being redirected.

This is probably also the easiest way to do it for non-programmers as well. Check with your web host to see if you can make changes like this through the control panel of your server. Most shared servers (those you "rent" from a reseller) use cPanel X or some variation. If they do, redirection is a simple point and click operation. If they have some other control panel, you'll need to contact their tech support.

If you look in the documents that came with AOM, you'll find instructions for changing "shop.php" to "index.php". Make the change in the file and upload it to your server as "index.php"...and then your store becomes the site's main page.

Hope that helps.

LindaBell009
Experience Level 1
Experience Level 1
Posts: 27
Joined: Fri Sep 02, 2005 12:02 pm
Contact:

Index.Php in instructions

Post by LindaBell009 » Mon Sep 05, 2005 9:22 pm

<<If you look in the documents that came with AOM, you'll find instructions for changing "shop.php" to "index.php". Make the change in the file and upload it to your server as "index.php"...and then your store becomes the site's main page. >>

The instructions say:
>>This is the main PHP script that powers Associate-O-Matic. You can rename this file to whatever you'd like so long as it ends in ".php" (e.g index.php, store.php, etc...)

NOTE: If you rename the file, you must also edit the non-encrypted portion of the file where it says $codelock_file="shop.php" to whatever the new name is. <<

I have no idea how to edit this type of file, nor what the <<$codelock_file="shop.php">> means.

So, I'm off to get the file you recomended!

Thanks for a beginner,
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

LindaBell009
Experience Level 1
Experience Level 1
Posts: 27
Joined: Fri Sep 02, 2005 12:02 pm
Contact:

My server has a redirect, TOOOO!

Post by LindaBell009 » Mon Sep 05, 2005 9:57 pm

It's called redirect url on my server.

It had a "from part" which already had http://www.MyDomainName.con ____ (a blank place)

So, in the blank place, I added index.html (which my website already had)

For the "to part" I tried to put http://MyDomanName.com/shop.php. It didn't work. So I tried http://www.MyDomainName.com/shop.php.

And it worked!

I don't know why the www. was so important because you can get to my site eather way.

And it doesn't matter.

I'm going to put this in the tricks section of this discussion board.

Thanks for the lead!
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

Telejoke
Experience Level 3
Experience Level 3
Posts: 116
Joined: Tue Apr 26, 2005 10:01 pm

Post by Telejoke » Tue Sep 06, 2005 8:02 am

NOTE: If you rename the file, you must also edit the non-encrypted portion of the file where it says $codelock_file="shop.php" to whatever the new name is. <<

I have no idea how to edit this type of file, nor what the <<$codelock_file="shop.php">> means.
Actually, you can open the file in Notebook or any editor that saves text files. the file looks like munge except for the top line. That's where you find the variable $codelock_file="shop.php". Change the "shop.php" to "index.php" and save the file...

I'm glad you figured out how to do it by redirection. That allows you to use AOM as your main page. I had to do the trick above because we want a main page different than the one AOM displays. It's helpful to know more than one way to skin this kitty. . . ;-)

LindaBell009
Experience Level 1
Experience Level 1
Posts: 27
Joined: Fri Sep 02, 2005 12:02 pm
Contact:

Thanks

Post by LindaBell009 » Tue Sep 06, 2005 10:56 am

With your permission, I'll put a post in the Tips file so other beginners like me will know how to do it.
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

associate-o-matic
Admin
Admin
Posts: 1879
Joined: Fri Oct 01, 2004 10:40 pm
Contact:

Site Home Page setting in v2.5

Post by associate-o-matic » Thu Sep 15, 2005 5:21 pm

Just an FYI, we've added a new Site Home Page setting to v2.5 that will let you specify how you want the home page to look. No more ambiguity of settings to wondering what will appear on the home page.

The formats are...

Blended:
Lists up to 3 items from each of your site categories. Requires the Site Default Keyword (above) and Site Home Blended Items (below)

Single Item:
Displays a detailed view of a single item (Amazon ASIN). Requires the Site Home Item (below)

Browse Node:
Displays 10 items (with more items paginated) from the node of your choice. Requires the Site Home Node information (below)

ASIN List:
Lists up to 10 ASINs. Requires the Site Home Asins (below)

Mall:
Lists links to your site categories.

Custom HTML:
Displays your own HTML. Requires the Site Home Html (below)


Justin
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

rickg
Posts: 1
Joined: Sun Jul 02, 2006 1:23 pm

Post by rickg » Sun Jul 02, 2006 1:25 pm

There's a better way, actually. Out of the box, shop.php should simply be called index.php. Most hosts will recognize this as a default page, so no changes would be needed. Given how things are at the moment though, all of the above is valuable info...

bdmunee
Posts: 1
Joined: Sat Jul 15, 2006 11:07 am
Contact:

Post by bdmunee » Sat Jul 15, 2006 11:11 am

bloodwrath wrote:You could also do this

This is the main PHP script that powers Associate-O-Matic. You can rename this file to whatever you'd like so long as it ends in ".php" (e.g index.php, store.php, etc...)

NOTE: If you rename the file, you must also edit the non-encrypted portion of the file where it says $codelock_file="shop.php" to whatever the new name is.

i.e. http://www.yoursite.com/shop.php

so i renamed it to index.php
This doesn't work for me. I'm trying to get the shop to resolve to the main domain: http://www.maindomain.com

Not: http://www.domain.com/shop.php

Someone please help me with this. My site is http://www.hankjonesrules.com/shop.php
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

kohashi
Posts: 1
Joined: Tue Jan 02, 2007 7:41 pm
Contact:

Post by kohashi » Tue Jan 02, 2007 7:47 pm

A simple way is to use .htaccess to re-write URLs. This is how I would rewrite your main directory to shop.php.

Just include this code in a file called .htaccess in the public_html directory and you should be set. Plenty of modrewrite tutorials can be found just searching google.

Code: Select all

Order Allow,Deny
Allow from all


Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteRule ^index.html shop\.php
RewriteRule ^index.php shop\.php

animas
Experience Level 2
Experience Level 2
Posts: 54
Joined: Fri Mar 07, 2008 8:12 am

Re: Modify the Default Homepage for your Domain

Post by animas » Tue Mar 11, 2008 12:23 am

What about http://www.domain.com/subfolder/shop.php ?
What should I write in .htaccess? Because I can see at http://www.domain.com page layouts seems broken.
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

mcarp555
Admin
Admin
Posts: 4088
Joined: Thu Sep 14, 2006 5:19 pm
Location: United Kingdom
Contact:

Re: Modify the Default Homepage for your Domain

Post by mcarp555 » Tue Mar 11, 2008 5:02 am

Put DirectoryIndex shop.php as the first line of the .htaccess file. Note, the .htaccesss file must be in the same location as your shop.php file.
Associate-O-Matic is changing. For the better. 8)

Please CLICK HERE for our important announcement.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests