Jump to content

Archived

This topic is now archived and is closed to further replies.

nero

How to make myurl.com/ easily redirect to myurl.com/catalog/

Recommended Posts

Just curious, but why not make a new index.php page that contains lots of content, which links directly to your default.php page? Seems to me that if you have the right content, the search engines will still rank you high....

 

And an intro to your store might give people a chance to review what you are selling and offering anyways.....

 

cheers....


Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Share this post


Link to post
Share on other sites

It's another click to get from an index page, to your sales pages...that extra click would put me off of buying from you...

 

Vince: AFAIK, there would be no Spidering issues with the httpd.conf change nor with baonguyenx solution.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Hi Peter,

 

I think the original poster just wants to have the exact content of file catalog/default.php under his htdocs web root. He doesn't want to do the hard way by creating new file. The easiest way is to make 'default.php' under htdocs as a symbolic link to 'catalog/default.php'. Also, 'includes' folder under htdocs must exist since the codes in all osc pages are referring to the relative 'includes' folder. Just make 'includes' folder under htdocs points to 'catalog/includes' folder.

 

Here are just the two simple commands to achieve that under htdocs!!!

ln -s catalog/default.php default.php

ln -s catalog/includes includes

 

Gary, for some people if the are on a share hosting, they don't have access to make change of httpd.conf. Symbolic link is simple, and it is working on all my websites.

 

Regards,

Bn

Share this post


Link to post
Share on other sites

Just looking at a refresh option for a page inside the catalog area. What I have done is refreshed the checkout_payment.php to go directly to checkout_confirmation.php with the following head code:

 

<meta http-equiv="refresh" content="0;URL=checkout_confirmation.php">

 

However, the main problem isn't that a refresh is accomplished successfully, but that the session is broken and therefore the whole session process is messed up.

 

Is there some php code that I can use instead of the above to retain the integrity of the site?

 

I did try:

 

<meta http-equiv="refresh" content="0" URL=<? echo ' . tep_href_link(checkout_confirmation.php, 'NONSSL') . ';?>>

 

But that's because my PHP knowledge is very basic!

 

Any help, much appreciated.

Share this post


Link to post
Share on other sites

To be honest, I've no idea and wouldn't know where to start on that. However, I've been scratching my head all night over this one and think I've sorted it.

 

Looking at what I did earlier, I replaced the code

 

<meta http-equiv="refresh" content="0;URL=checkout_confirmation.php">

 

with

 

<meta http-equiv="refresh" content="0;URL=<?php echo '' . tep_href_link(FILENAME_CHECKOUT_CONFIRMATION,'', 'SSL') . '';?>">

 

Now works a treat and brings the session information with it!

Share this post


Link to post
Share on other sites

Sorry to bring up an old topic - but is it easy to move all of the content to the root? I'd really like to do it, but don't think I have enough PHP knowledge to edit a load of files if the paths need changing.

 

Thanks.

Share this post


Link to post
Share on other sites

It is not difficult, you just move the files from the catalog folder to the root and then change the paths in both config files and your done

Share this post


Link to post
Share on other sites

I am suprised nobody has mentioned modifying the HTACCESS file,

I have had the same problem before, and here is what I did,

I just made my htaccess file look like this. (apache server)

 

# $Id: .htaccess,v 1.2 by Steven Pignataro 08/27/02 hpdl Exp $
#
# This is used with Apache WebServers
#
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
#
# For this to work, you must include the parameter 'Limit' to the
# AllowOverride configuration
#
# Example:
#
#<Directory "/usr/local/apache/htdocs">
# ?AllowOverride Limit
#</Directory>
#
# 'All' with also work. (This configuration is in your
# apache/conf/httpd.conf file)

DirectoryIndex /shop/catalog/default.php

<IfModule mod_setenvif.c>
?<IfDefine SSL>
? ?SetEnvIf User-Agent ".*MSIE.*" \
? ? ? ? ? ? nokeepalive ssl-unclean-shutdown \
? ? ? ? ? ? downgrade-1.0 force-response-1.0
?</IfDefine>
</IfModule>


*Outlined in chalk everone looks the same*

 

Currently useing OSC 2.2 MS1

running on Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_jk/1.2.0 mod_perl/1.26 PHP/4.3.3 FrontPage/5.0.2 mod_ssl/2.8.12 OpenSSL/0.9.6b

Share this post


Link to post
Share on other sites

Just to add one more trick to the list: My web hosting provider allows me to point the domain to any directory using their Control Panel. You can also ask your host to do this for you; most will be happy to oblige. Easier than messing with symbolic links and .htaccess files, although I have used both of those tricks before.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Glad this old topic has been revisited ... I installed my website at www.generationsbookco.com without configuring ssl. When I went to add ssl, I got certificate from my hosting company, but it only covers stuff in my /secure directory (vs. /public where I currently have OSCommerce installed).

 

I copied my public/catalog directories to /secure/catalog and then went to /secure/catalog/admin/includes/configure.php. Now I'm not sure exactly what to do.

 

1) Is it as simple as modifying:

 

define('HTTPS_CATALOG_SERVER', '');

define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

 

to

 

define('HTTPS_CATALOG_SERVER', 'https://www.securewebexchange.com/generationsbookco.com');

define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module

 

2) Also, do I have to change all the absolute references to the /secure directory (making everything run in secure) or is there logic built into oscommerce to only go to the /secure directory when a piece of sensitive data is being transmitted?

 

3) Finally, should my database be located within the /secure directory?

 

Thanks for any help you can provide.

Share this post


Link to post
Share on other sites

Hmm ... the symbolic links and the .htaccess file tips both work fine, but does anyone know how to arrange things so that when you click 'Top>>' on the breadcrumb line you actually get the first page of your OSC site rather than the Apache splash page? At present I have to click 'Catalog>>' to get the first page... confusing for customers ...

 

TIA

 

:)

Share this post


Link to post
Share on other sites

I just removed the 'Top>>' entirely. The top level then becomes 'Catalog'. Just find this code in application_top.php:

// include the breadcrumb class and start the breadcrumb trail
 require(DIR_WS_CLASSES . 'breadcrumb.php');
 $breadcrumb = new breadcrumb;

 $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

and change the last line to this:

  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

What's wrong with a simple redirect in the .htaccess file? When you goto myurl.com it just goes straight to myurl.com/shop ie.

 

Redirect permanent /index.html http://myurl.com/shop/

 

I must admit I don't know how this would affect search engines though.

Share this post


Link to post
Share on other sites

That will work just fine for your customers. Search engines are reputed to hate redirects; some even state that they will not follow them. I have no idea if this means redirects in the header (which the .htaccess trick will do) or only HTML redirects.

 

Some people are running osCommerce on webhosts that do not allow .htaccess files, or on Windows servers that do not use .htaccess, so they need other ways to accomplish this. Fortunately there are several methods available.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I have copied ALL of my files (excluding the catalog folder--- which I had named store) to the root directory....

 

Now, in the config file how do I define the part where it USE to be store?

define('HTTP_COOKIE_PATH', '/store');

define('HTTPS_COOKIE_PATH', '/store');

define('DIR_WS_HTTP_CATALOG', '/store/');

define('DIR_WS_HTTPS_CATALOG', '/store/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', '/var/www/html/store/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

Im a little lost...

 

Thanks

tammy

Share this post


Link to post
Share on other sites

301 permanent redirects (using .htaccess) are search engine safe & the right way to handle moved pages.

 

META refresh & variations have a spammy reputation and are frowned on (at best) by the search engines.

 

I hope this helps,

 

Bob

 

That will work just fine for your customers. Search engines are reputed to hate redirects; some even state that they will not follow them. I have no idea if this means redirects in the header (which the .htaccess trick will do) or only HTML redirects.

 

Some people are running osCommerce on webhosts that do not allow .htaccess files, or on Windows servers that do not use .htaccess, so they need other ways to accomplish this. Fortunately there are several methods available.

 

Regards

Jim


Get More From osCommerce With Custom PHP-MySQL Programs

Share this post


Link to post
Share on other sites
I have copied ALL of my files (excluding the catalog folder--- which I had named store) to the root directory....

I got it, thanks anyway. I just removed all "store" references.

Share this post


Link to post
Share on other sites
I am suprised nobody has mentioned modifying the HTACCESS file,

I have had the same problem before, and here is what I did,

I just made my htaccess file look like this. (apache server)

 

# $Id: .htaccess,v 1.2 by Steven Pignataro 08/27/02 hpdl Exp $
#
# This is used with Apache WebServers
#
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
#
# For this to work, you must include the parameter 'Limit' to the
# AllowOverride configuration
#
# Example:
#
#<Directory "/usr/local/apache/htdocs">
# ?AllowOverride Limit
#</Directory>
#
# 'All' with also work. (This configuration is in your
# apache/conf/httpd.conf file)

DirectoryIndex /shop/catalog/default.php

<IfModule mod_setenvif.c>
?<IfDefine SSL>
? ?SetEnvIf User-Agent ".*MSIE.*" \
? ? ? ? ? ? nokeepalive ssl-unclean-shutdown \
? ? ? ? ? ? downgrade-1.0 force-response-1.0
?</IfDefine>
</IfModule>

 

Thanks for this idea - I still couldn't figure out if this is a good way for spiders and search engine rankings... Do you know? I have my index.php in the root filder it's not automatically loading by entering www.myurl.com so i had to use your suggestion...

 

I appreciate your time! Casi

Share this post


Link to post
Share on other sites

I have heard opinions on both sides, so I can't really say if this will hurt you. On the other hand, your webserver is perfectly capable of delivering the index.php as the default page. If you are running your own webserver, this is handled in the appropriate config file. If you are on a hosting service, you should be able to change your default in your host's Control Panel. If you can't find it in the CP you should ask them to change this for you.

 

It's always best to have the server do the work for you.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

OK, my site has been up for a good while and i have over 4000 pages ranked by search engines. I dont want to lose these pages by changine things too much, but want to change from www.niknakgroup.com/jewellery/ (I changed the catalog folder to jewellery a while back) back down to www.niknakgroup.com - i can do this using my hosts control pane l quite easily, and know how to change the configure.php, but am confused as to how to get the 301 redirect in. I have tried putting in a new folder (current structure makes it www.niknakgroup.com/jewellery/jewellery) containing a 301 redirect to the main url, but will this work for people coming in on exact page links (i.e. www.niknakgroup.com/jewellery/index.php?cPath=297) so that they still get the correct page, and so that the search engines can still get back in on all th elinks they have found before. I also need to know my link exchange programme wont become completely irrelevant if I change things. Any help/advice greatly appreciated!


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites

Let's look at this a different way. Instead of trying to redirect someone to the root directory from somewhere else, why not make the redirect in .htaccess a 404 redirect (file not found), so that if they go to a page which no longer exists they will end up on the index page. This is good for established sites anyway as (over time) you are bound to delete pages which previously existed, and it's much better for people to end up on the index page than on a 404 error page.

 

Vger

Share this post


Link to post
Share on other sites

×