Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moving /shop/Index.php to <root>/index.php


majika

Recommended Posts

Hello all,

 

I would like to know the effects of my planned movement of my index.php file from its current location https://www.domain-name.co.uk/shop/index.php to the root directory of my website https://www.domain-name.co.uk/index.php

 

This index.php will then make calls to the '/shop/' directory from where it once came from..

 

The current structure of my shop/website is as follows

 

 

www.domain-name.com/shop/index.php (this is where my shop currently lyes)

 

In the cPanel File Manager it looks like this attempt at a diagram, like so:

(This is not the exact layout only an example, including essential files and folders and website layout)

 

home/domain/
	 |->	/direcory/
	 |->	/directory/
	 |->	.fantasticodata
	 |->	.htaccess
	 |->	/etc/
	 |->   /www/
	 |->   /public_html/
				 |->		/cgi-bin/
				 |->		/support/
				 | ->	   /shop/index.php (and rest of OSC files)
				 |->		/blog/
				 |->		/downloads/
				 |->		/error-pages/
				 |->		/directory/
				 |->		/index.html	(This page doesn't even get landed on when a visitor types in my domain because of custom .HTACCESS file)
				 |->		/index.php	 (same explanation as above - see my .HTACCESS file below for overall picture of website layout !!)
				 |->		/robots.txt
				 |->		/
				 |->		/all the usual stuff in here
				 |->		/favico.ico
				 |
				^

				|->  /index.php ( This is where I want to move my new index page to out of the /shop/ directory !!!

 

 

 

HERE IS A CENSORED VERSION OF PRIMARY .HTACCESS FILES (true url swapped to domain-name.co.uk For security) 

## The following line is set by server admin and is REQUIRED [ADDED EXTRA FEATURE]

Action application/x-httpd-php5 /cgi-bin/php.cgi

RewriteEngine On

RewriteBase /


########## Begin - domain Sub-Domain and TLD Redirects and forwarders
## These lines are required and work when the rest of this htaccess file
## was not adopted

RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteRule ^(.*)$ https://www.domain-name.co.uk/shop/index.php [R=301,L]

RewriteCond %{HTTP_HOST} ^domain-name.info$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.info$
RewriteRule ^http://www.domain-name.info/support/index.php$ [R=301,L]

RewriteCond %{HTTP_HOST} ^domain-name.co.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.co.uk$
RewriteRule ^index.php$ http://www.domain-name.co.uk/shop/index.php [R=301,L]


RewriteCond %{HTTP_HOST} ^support.domain-name.co.uk$
RewriteRule ^(.*)$ http://www.domain-name.co.uk/support/index.php [R=301,L]

##
## DELETED FROM ORIGINAL .info 
##
###	 RULE = RewriteRule ^(.*)$ http//www.domain-name.co.uk/support/index.php [R=301,L]
##
##
########### End - domain-name Sub-Domain Redirects and TLD Forwarder

 

Before I go any further I would just like to point out that I do in fact own all those TLD and ccTLD (mobi, com, co.uk, info, biz, org, net, me.uk, org.uk, ws)

I have just not included them yet in my project just for **Safe keepings**

 

HERE IS A COPY OF MY CONFIGURE.PHP FOR MY OSC SHOP  AS TO AID IN HELPING MY TO TRY TO MOVE MY INDEX PAGE AND NOT KILL THE SITE

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://www.domian-name.co.uk'); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', 'https://www.domian-name.co.uk'); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'www.domian-name.co.uk');
 define('HTTPS_COOKIE_DOMAIN', 'www.domian-name.co.uk');
 define('HTTP_COOKIE_PATH', '/shop/');
 define('HTTPS_COOKIE_PATH', '/shop/');
 define('DIR_WS_HTTP_CATALOG', '/shop/');
 define('DIR_WS_HTTPS_CATALOG', '/shop/');
 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', '/home/domain/public_html/shop/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

// define our database connection
 define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', 'hidden_user');
 define('DB_SERVER_PASSWORD', '*&^%&$£&');
 define('DB_DATABASE', 'domain-name_shop');
 define('USE_PCONNECT', 'false'); // use persistent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

 

Brief reasons for change are as follows:

 

I used to also run a CMS which used to occupy the root location, the same place in fact to where I now want my shop's landing page to be placed at. The CMS has now gone and has left my Google Score drop as to my Alexa drop also. :( anyway, I also wish to make my SEO attempts much more fluid and by completing this attempted approach I hope to achieve a lot of my goals. So I hope that one of you will be able to come up with a nice easy solution.

 

I am NOT a PC Novice I have vague PHP skills and good HTML and CSS, Apache Mod_rewrite etc so I though I would get some feedback and advice before I make the jump "Sort of speak"

 

At the moment all the sites are working fine as you can see from the .htaccess file all attempts to reach any of my domain-name top level domains like .com of .info etc are directed to the correct locations. Another issue that I think will be a problem is how the includes in the index page will react to the change of directory to an upper level directory ? (Instead of it being /shop/index.php it would become just /index.php) So I guess the configure.php would be the answer to that problem then?

 

Another thought would be all my modifications that I have included not just to the shop but also to the admin section even though that is staying in the same place?

 

For Your Information: - System Specification phpinfo()

Server Host:  ___________ (xx.xxx.xx.xx)   Database Host:	  localhost (127.0.0.1)
Server OS: 	Linux 2.6.22.8 		 Database: 	MySQL 5.0.45-community
Server Date: 	01/23/2008 20:14:54 		 Datebase Date: 	01/23/2008 20:14:54
Server Up Time: 	20:14:54 up 5 days, 3:10, 0 users, load average: 1.08, 1.04, 1.02
HTTP Server: 	Apache/1.3.39 (Unix) mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 mod_ssl/2.8.30 OpenSSL/0.9.8b
PHP Version: 	5.2.4 (Zend: 2.2.0)

Server API 										 CGI
Virtual Directory Support 					disabled
Configuration File (php.ini) Path		   /usr/lib
Loaded Configuration File 					/home/domain-name/public_html/php.ini

Any and all advice, examples or thoughts would be very much appreciated.

 

Many, Many thanks in advance,

 

 

Majika

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...