PDA

View Full Version : The best way to get my homepage integrated into my oscmax site



earth-friendly
07-24-2009, 03:02 PM
Hi. I'm getting ready to release my new oscmax site. I have a very old site that I've been using. We've designed a new homepage that goes with the new site. I want it to be integrated into the oscmax site, so that it gets the header and boxes that are on the rest of the site. So I created a new file for the catalog directory, homepage.php, and a new template file, homepage.tpl.php, in the appropriate templates directory.

So, here's my concern. The new homepage is currently in
http://www.mysite.com/catalog/homepage.php.
But, I want people to be able to go to http://www.mysite.com or http://www.mysite.com/index.html and end up on the new homepage.
I think I need to either redirect from index.html to http://www.mysite.com/catalog/homepage.php or somehow store my homepage.php in index.html rather than in catalog/homepage.php.

I just tried to move catalog/homepage.php to index.html. It's a very short file:

<code>
<?php
$contentname = "homepage";
require('catalog/includes/application_top.php');
$content = $contentname . ".php";
$content_template = $contentname . ".tpl.php";
include (bts_select('main', $content_template)); // BTSv1.5
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
</code>

but this didn't work. It looks like there are some relative links in includes/application_top.php, for loading includes/configure.php, so this blew up.

Is there a good way of having the homepage in my www root directory like this, or should I do a redirect instead?
My concern with doing a redirect is, what is the right way to do this, for the search engines? Would doing a 301 redirect from the .htaccess file be appropriate for this case?

I think using .htaccess to do a 301 redirect is the best way to redirect for all the old pages that now have new versions in the oscmax site. But is it the best solution, for redirecting from the index.html to the catalog/homepage.php page?

Thanks in advance for any suggestions with this. I do have some good page rankings for my current site, and I'd hate to lose that when I upgrade to my new, wonderful oscmax site!

jpf
07-24-2009, 04:07 PM
Undo the file rename of homepage.php - really unnecessary if you have it in a sub directory! (I have like 12+ versions installed on one site - not one file was renamed)

Ether copy everything in "\catalog\" to "\" and edit your configure.php file (and .htaccess if you have SEO working) to remove "catalog\" (rename homepage.php back to index.php) remove any other index.* files...

or Use .htaccess to redirect them to your file

or create a simple one line index.htm with a (0 second) redirect to your file

Done!

earth-friendly
07-25-2009, 06:21 PM
My index.php file within oscmax is the product listing page.
But I have a homepage which has a different middle column, and links to different parts of the oscmax site. So I can't replace the index.php page with the contents of the new homepage--I need to keep both of them around.

So it looks like the other 2 choices are:
1) to use .htaccess to redirect from index.php to the new homepage file within the oscmax site, or
2) to have an index.html file which has a 0-second redirect to the new homepage file.

So the question is, which works better as far as the search engines are concerned? Some other sites do link to my index.html file, or just to my domain (www.mysite.com). And for certain keywords, I rank high in google. I don't want to lose that ranking. Do you know if either a 301 direct in .htaccess (is 301 the right one to use??), or a redirect from within my index.html file would provide better results of keeping my existing rankings?

Thanks for your help!
-Lori-

michael_s
07-25-2009, 06:41 PM
There is another option that is more elegant...

In .htaccess change the DirectoryIndex to prefer homepage.htm first, and index.php second, like this:

DirectoryIndex homepage.html index.php index.html

Now when someone visits your site http://www.yoursite.com, the first file the server will attempt to load is homepage.html. Problem solved. :)

Next, just build your homepage.html file to look like the osCMax site. That is easy enough to do.

earth-friendly
07-25-2009, 09:09 PM
Michael,
This would be great, except for the fact that some people may currently have links to www.mysite.com/index.html. So for those people, I still need to get them to the homepage.

Are you suggesting that I should have my pages at the root directory, rather than within the catalog directory? If I do that, I could use DirectoryIndex to make homepage.html be the preferred page to go to, if they go to www.mysite.com without specifying a file. But then, if they do specify www.mysite.com/index.html, then I could redirect them to www.mysite.com/homepage.html. Does that make sense?
Or would it be better/cleaner to have the oscmax pages within the catalog directory, and just redirect to homepage.html?
And, which redirect method is best for the search engines? The .htaccess method with a 301 redirect, or redirecting from within the meta tags of an index.html page?

Thanks both Michael and JPF for your help!!
Regards,
-Lori-

earth-friendly
07-26-2009, 10:29 AM
Ok, how about this. I rename my new homepage to index.html, and have it in the root directory (www.mysite.com/index.html). Then, this page can link to index.php, which is the product listing page. And I don't have to do any redirects, because I have an index.html. And, it is in my oscmax directory, so it easily gets all the oscmax boxes and header. Does it make sense to have an index.html and an index.php in the same directory? Will that mess anything up? Does this solution make sense? Or does one of the solutions involving redirection make more sense?

Thanks for the advice! I'm confused! I want to get this site finished and out there soon, but all these little details are getting me!

Regards,
-Lori-