Jacobytw Posted November 20, 2002 Posted November 20, 2002 hiya I currently have my store installed to a folder below the main htdocs directory on the server. I am just wondering if it possible to pull say the default.php up one directory e.g htdocs/default.php instead of /htdocs/catalog/default.php basically all i want to do is make default.php the home page for the whole website so that when you go to say www. website . com it load sthe default.php instead of having to have an index page that redirects to www . website . com/catalog/ anyhelp appreciated cheers
RickChase Posted November 20, 2002 Posted November 20, 2002 I suggest this... Create an index.html that looks like this.... <html> <head> <title>Welcome to wherever</title> <meta http-equiv="refresh" content="0; URL=catalog/defaut.php"> </head> <body bgcolor=000000></body> </html> And for the redirect url, just put in the url of your default.php. This way, anyone who visits yoursite.com is immediatelly redirected to the catalog. An easy fix.
Mark Evans Posted November 20, 2002 Posted November 20, 2002 I currently have my store installed to a folder below the main htdocs directory on the server. Why not just move the store the the main htdocs folder ;) Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds)
Jacobytw Posted November 20, 2002 Author Posted November 20, 2002 yes was thinking of moving it up one, would i have just have to change the paths in configure.pjp? cheers guys
Mark Evans Posted November 20, 2002 Posted November 20, 2002 yes was thinking of moving it up one' date=' would i have just have to change the paths in configure.pjp?/quote'] Yep just replace define('DIR_WS_CATALOG', '/catalog/'); with define('DIR_WS_CATALOG', '/'); and viola :D Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds)
rickag Posted November 20, 2002 Posted November 20, 2002 I suggest this... Create an index.html that looks like this.... <html> <head> <title>Welcome to wherever</title> <meta http-equiv="refresh" content="0; URL=catalog/defaut.php"> </head> <body bgcolor=000000></body> </html> <snip> An easy fix. Do you know if this will mess up search engine bots or cause them to downgrade your site? Ricka Ricka Gerstmann
antics22 Posted November 20, 2002 Posted November 20, 2002 I have my site setup like the way you want it and it is very easy. Simply put an .htaccess file at your root folder directing it to go to /catalog/default.php. Instead of having yoursite.com/index.html come up when you go to yoursite.com, the htaccess file will change it to be yoursite.com/catalog/default.php instead. Heres how: 1 - Open up notepad or whatever plain text editor 2 - Type in: DirectoryIndex filename.html (where filename.html is wherever your default.php is) for example, mine loos like this: DirectoryIndex catalog/default.php 3 - Save it as: .htaccess (and make sure when you save it, that you select "all files" and not a text document. Otherwise, it will save as ".htaccess.txt" which WILL NOT WORK!) 4- Place the .htacces file at your root. That should do it. Now when a user types in yoursite.com, your site will look for catalog/default.php in your root directory (or any directory if you specify this in the global htaccess), and if it finds it, it will load that page as the default page. If it does not find default.php (or whatever file you set it for) it will default to its original index page. Got it? give it a try, it should work! -AnticsBABY!!! :lol:
antics22 Posted November 21, 2002 Posted November 21, 2002 I forgot to add the forward slash... Your .htaccess line should read: DirectoryIndex /catalog/default.php instead of: DirectoryIndex catalog/default.php -Ant
itwebsolution Posted January 4, 2003 Posted January 4, 2003 I have tried the .htaccess approach used above but for some reason, now I cannot access the "admin" interface. Is there a value I need to change somewhere because the site root is changed through the use of the .htaccess modification? Thanks!
loxly Posted January 4, 2003 Posted January 4, 2003 I orginally tried installing in a root directory and had to reinstall in the catalog directory because I couldn't get it all to work happily. I have a redirect file in the root for a homepage, make sure you put an index.html or .php file there to prevent people from going there and creating a possible security hole. Search engines don't mind subdirectories, they are pretty much going to find you from pages that link to you, I have several sites that get search engine hits on maily subdirectory pages and rarely on the darn home page! I also have a "framed" url pointing to the subdirectory. Try http://loxlygallery.com it is really http://4fundraising.org/phoenix/catalog but site visitors coming from loxlygallery.com are only shown loxlygallery.com and it is a top level domain registered with the search engines. Debbie [no external urls in signatures please, kthanks]
itwebsolution Posted January 4, 2003 Posted January 4, 2003 I guess I will go that router because I have already spent four hours too many on this as it is! If anyone figures out the .htaccess though, I would like to hear how it is done!
mgraphics Posted February 6, 2003 Posted February 6, 2003 If you cut and paste Rickag's sugestion, don't forget to add an 'l' to the word defau_t like I did! -Doug
robertl Posted February 6, 2003 Posted February 6, 2003 See http://www.oscommerce.com/forums/viewtopic.php?t=32695 The best way is to change the name of the default.php to index.php and goto inc/application_top.php and change from default.php to index.php, then in your language files change the default.php files to index.php also. Redirection will kill your site with about just every search engine. Robert L.
agtlewis Posted February 6, 2003 Posted February 6, 2003 I suggest this... Create an index.html that looks like this.... <html> <head> <title>Welcome to wherever</title> <meta http-equiv="refresh" content="0; URL=catalog/defaut.php"> </head> <body bgcolor=000000></body> </html> And for the redirect url, just put in the url of your default.php. This way, anyone who visits yoursite.com is immediatelly redirected to the catalog. An easy fix. Bad Idea, Search Engines Hate Meta refresh tags, make a copy of default.php and rename it to index.php -- That will work fine.
itbejared Posted February 17, 2003 Posted February 17, 2003 this is all great info... you know this forum is the best! thanks you guys! :D
itbejared Posted February 18, 2003 Posted February 18, 2003 OK, I have tried the .htaccess thing and I couldn't get it to work right. I tried using the meta tag index.htm and it worked without a problem. but now I am worried about the search engines. Will this or will this not effect a search eninge in an adverse way?
Guest Posted February 19, 2003 Posted February 19, 2003 OK, I have tried the .htaccess thing and I couldn't get it to work right. I tried using the meta tag index.htm and it worked without a problem. but now I am worried about the search engines. Will this or will this not effect a search eninge in an adverse way? YES! It WILL affect a seacrh engine in an adverse way! This USED to be a valid way to re-direct to your main page if your main page was not named index.html. Now, almost ALL search engines will NOT index your site, if the first page they hit contains a META refresh tag. If you want to build a splash page that redirects automatically to your main page, then USE JAVASCRIPT. Javascript re-directs will not jeopardise your search engine indexing. If you want the js code to do this, let me know.
Guest Posted February 19, 2003 Posted February 19, 2003 If you want to create an index.html page that has the osCommerce "look", you could try what I did in a small redesign of the default.php page. View here: http://teejaycom.us
itbejared Posted February 19, 2003 Posted February 19, 2003 Hey thanks teejay, I would love to have the js code.. I am just looking for somethign to won't effect the search engines and if JS is my answer I muchly appreciate you assistance!
Guest Posted February 19, 2003 Posted February 19, 2003 I mentioned earleier about the "gurus" ... Here is what they say about page re-directs, and the js code you need for the workaround: We suggest you build a "splash page" or an alternate index page that has been coded exclusively for the search engines. Now, some people don't want to do that for fear that users may not click beyond the splash page. There is a way around this, using a simple JavaScript. We configure a splash page that automatically targets another page, such as your "real" index page. Be careful not to use a Meta Tag "refresh" as many search engines will pass you by. Using this small script, however, search engines will index your page and browsers will jump right to the page you want your visitors to go to. Here's how it works: First create a page that is Search Engine Optimized. This means proper Meta Tag code and attention to the content to match those tags. You can test your Tag and Content with our free tools before submitting to the search engines. (see URL below) Next place a hyperlink to your real index page so that older browsers won't get lost. Then place this JavaScript on your page to automatically launch the page you want: <SCRIPT LANGUAGE="JavaScript"> window.location = "your_page.html"; </SCRIPT> HTH
Kelly_Hero Posted March 12, 2003 Posted March 12, 2003 Hey yall, I've installed the JavaScript workaround mentioned above and it works beautifully! Thank you very much! I was just wondering if anyone else who has been using this workaround for a while has any data regarding their search engine placement after the script was installed? I need to be able to justify this method to my client who has just shelled out bucks for paid placement and who is very concerned that any changes to the website might affect their rankings. Thanks! Happiness does not come from doing easy work but from the afterglow of satisfaction that comes after the achievement of a difficult task that demanded our best. --Anonymous
Kelly_Hero Posted March 17, 2003 Posted March 17, 2003 Maybe it's better if I rephrase this question. I found some information that says it's better for your rankings in search engines, especially Google, to use server side redirects rather than JavaScript. Does anyone know if this is true or not? How would I create a server side direct in PHP? I tried looking at the OSC redirect.php page, but I couldn't figure out which part I needed to emulate. Please help. Thanks! Happiness does not come from doing easy work but from the afterglow of satisfaction that comes after the achievement of a difficult task that demanded our best. --Anonymous
Recommended Posts
Archived
This topic is now archived and is closed to further replies.