matrix2223 Posted September 30, 2010 Share Posted September 30, 2010 Not sure what you mean tbh, the corrected file was for the contribution Google XML sitemap seo. Yes that was the contribution I was referring to. When I replaced that file with yours the googlesitemap/index.php and sitemap.class the googlesitemap/index.php does not display properly. If you would like I can post a screen shot. Thanks Eric Quote Link to comment Share on other sites More sharing options...
matrix2223 Posted September 30, 2010 Share Posted September 30, 2010 (edited) What I mean is, the SSL is a different web domain to mine, so is it possible to rewrite it as my domain name using USU5? The ans to that is no. This only rewrites the extraordinarily long url for products and such. Once a user go to a ssl page they are not viewing any product page so no seo url will change that. Further more there is no way to change the your url with a shared ssl cert. eg. https://yourhost.com/~myuser/ unless you do a <frame> page but here isn't the board to discuss that. Even if you did a frame page you still wouldn't get the result one typically would be looking for, and as a customer really wouldn't be looking for. I hope that clears it up a little. Eric Edited September 30, 2010 by matrix2223 Quote Link to comment Share on other sites More sharing options...
matrix2223 Posted September 30, 2010 Share Posted September 30, 2010 Take a look in ultimate_seo_urls5/modules/ all of the modules are in there like information pages/articles/newsdesk etc. I don't see the point of links manager. True on the links manager, however its not by me thats requesting it. With the urls I have in the admin>config use category in url set to true but it is still only showing only the product only. eg. it only show /my-product O, BTW I applaud you on get the url to nix out the p-2.html nicely done. Thanks for your time, Eric Quote Link to comment Share on other sites More sharing options...
zipicip Posted October 1, 2010 Share Posted October 1, 2010 I don't know if this future exist so here is my question: Let say u added a product in your catalog with name: adidas shoes the link will be generated and crawled by google. After a month u decided to change the name of the product: let say adidas men shoes link will be generated and crawled by google and u get duplicate content I think the seo url class should add a 301 redirect sau google will know that this is the same page. Quote Link to comment Share on other sites More sharing options...
platnumcn Posted October 1, 2010 Share Posted October 1, 2010 Hello, anybody can get a help Hello, when i open google webmater tool, found there is thousand of duplicate meta tag, some page come with 30 different url for same contetn page, and the code in url are very strange, don't know where it come from, the url is like below for same url, the seo url i am using is umliate seo url and header tag seo and canonical_links, anybody know why so much strange url for same content page. Please help. domain/shoes-c-33.html?%252525252525253Blanguage=en domain/shoes-c-33.html?%2525252525253Bcurrency=GBP?cPath domain/shoes-c-33.html?;language=en%3F%253Blanguage%3Den?cPath domain/shoes-c-33.html?page=1&%25253Blanguage=en%253FcPath%253D33%3FcPath&sort=2a domain/shoes-c-33.html?page=11&%25253Bcurrency=GBP%252525253FcPath%252525253D33%25253FcPath%25253D33&sort=2a domain/shoes-c-33.html?page=11&;currency=CAD&;amp;language=en%3FcPath%3D33&sort=2a domain/shoes-c-33.html?page=2&;language=en&sort=2a domain/shoes-c-33.html?page=2&sort=2a&%3Bsort=2a%2525253FcPath%2525253D33%253FcPath%253D33 domain/shoes-c-33.html?page=3&%25253Bcurrency=GBP&%25253Bamp%25253Blanguage=en%3FcPath%3D33&sort=2a domain/shoes-c-33.html?page=3&%25253Blanguage=en%253FcPath%253D33%3FcPath&sort=2a domain/shoes-c-33.html?page=3&sort=2a&%3Bsort=2a%2525253FcPath%2525253D33%253FcPath%253D33 domain/shoes-c-33.html?page=4&%25253Blanguage=en%253FcPath%253D33%3FcPath&sort=2a domain/shoes-c-33.html?page=4&sort=2a&%2525253Bsort=2a domain/shoes-c-33.html?page=5&%25253Blanguage=en%253FcPath%253D33%3FcPath&sort=2a domain/shoes-c-33.html?page=6&%25253Bcurrency=GBP%252525253FcPath%252525253D33%25253FcPath%25253D33&sort=2a domain/shoes-c-33.html?page=6&%25253Blanguage=en%253FcPath%253D33%3FcPath&sort=2a domain/shoes-c-33.html?page=7&;currency=CAD&;amp;language=en%3FcPath%3D33&sort=2a domain/shoes-c-33.html?page=9&%25253Bcurrency=GBP%252525253FcPath%252525253D33%25253FcPath%25253D33&sort=2a domain/shoes-c-33.html?page=9&;currency=CAD&;amp;language=en%3FcPath%3D33&sort=2a Quote Link to comment Share on other sites More sharing options...
Guest Posted October 1, 2010 Share Posted October 1, 2010 I noticed 1 page ago that Jason was posting his website here, so I visited it. Can you tell me how he makes the URL's look like this? h*tp://www.sweetpaperlane.com/chatsworth-collection there is no p-3268 or no numbers or anything in his URLs, only category name and product name. Is he using USU5? Quote Link to comment Share on other sites More sharing options...
matrix2223 Posted October 1, 2010 Share Posted October 1, 2010 I noticed 1 page ago that Jason was posting his website here, so I visited it. Can you tell me how he makes the URL's look like this? h*tp://www.sweetpaperlane.com/chatsworth-collection there is no p-3268 or no numbers or anything in his URLs, only category name and product name. Is he using USU5? In your admin configuration setting set the USU5 setting to use standard seo urls and not traditional seo urls Quote Link to comment Share on other sites More sharing options...
Guest Posted October 1, 2010 Share Posted October 1, 2010 if I change "Choose URL Rewrite Type" from rewrite to standard, it will look like this: blabla.com/index.php/product-p-3 soo, this is not really the desired result and there is still the p-3 in it Quote Link to comment Share on other sites More sharing options...
bwaldie Posted October 2, 2010 Share Posted October 2, 2010 Using the 'standard' vs 'rewrite' format, you are correct. It adds the #morepics at the end. http://nalsworkshop.com/product_info.php/-p-212#morepics However, when using the 'rewrite' format the links are: http://nalsworkshop.com/-p-212#morepics.html Any help would be greatly appreciative. Thank you in advance. Naloomi This may be too late, but you need to make the change to includes/modules/more_pics.php not in product_info.php Quote Link to comment Share on other sites More sharing options...
blr044 Posted October 3, 2010 Share Posted October 3, 2010 Have installed this mod to OSC to CSS ver 2.0. Have read your thread and there were many post regarding the rewrite mod. In the standard settings, the URL displays as in your instructions. As you can see below but while at product_listing, URL includes index.php: Selecting a category:http://www.greatdiscounts4u.com/osc_to_css/index.php/dvd-movies-c-3'>http://www.greatdiscounts4u.com/osc_to_css/index.php/dvd-movies-c-3 After selecting sub-category: http://www.greatdiscounts4u.com/osc_to_css/index.php/dvd-movies-drama-c-3_15'>http://www.greatdiscounts4u.com/osc_to_css/index.php/dvd-movies-drama-c-3_15 URL at product_info: http://www.greatdiscounts4u.com/osc_to_css/product_info.php/beloved-p-20'>http://www.greatdiscounts4u.com/osc_to_css/product_info.php/beloved-p-20 Now go to admin settings, I change standard to rewrite and insert the below in /osc_to_css/.htaccess: # http://www.greatdiscounts4u.com/osc_to_css/ = rewritebase /osc_to_css/ RewriteBase /osc_to_css/ and edit the line of code located in /osc_to_css/includes/modules/ultimate_seo_urls5/includes/Usu_Init.php to: // Options rewrite and standard ( rewrite requires mods to .htaccess) @define( 'SEO_URLS_TYPE', 'rewrite' ); // Recommended rewrite The admin settings is as following: Set the number of days to store the cache. 7Turn debug reporting on true/false. false Enter special character conversions. Choose URL Rewrite Type rewrite Output W3C valid URLs? true Filter Short Words 1 Add category parent to beginning of URLs? true Add cPath to product URLs? false Enable SEO URLs 5? true Remove all non-alphanumeric characters? true Reset SEO URLs Cache Select caching system. FileSystem And so after changing to rewrite, now when I select any category, I get the 404 Error page. Quote Link to comment Share on other sites More sharing options...
spoofy Posted October 3, 2010 Share Posted October 3, 2010 I noticed 1 page ago that Jason was posting his website here, so I visited it. Can you tell me how he makes the URL's look like this? h*tp://www.sweetpaperlane.com/chatsworth-collection there is no p-3268 or no numbers or anything in his URLs, only category name and product name. Is he using USU5? I really like that too. I doubt this mod can accomplish something like that. All the urls are nice and clean such as shoppigng_cart login etc Quote My Contributions: Google XML Sitemap SEO compatible with Ultimate SEO URL by FWR Media ::: Accurate & Precise Bread Crumb Trail Link to comment Share on other sites More sharing options...
spoofy Posted October 3, 2010 Share Posted October 3, 2010 Hey FWR Media: I have a question for you. I create a separate column in products table in database. I will be using this column for url title. Here is what I mean: Current setup: The product name is included in the url with p-123 so basically nike-shoes-p-456.html for a product called "nike shoes" What I would like to do is this: Leave the product name "nike shoes" however, the url title (slug) will be "running nike shoes". My database column already has this. I would like the url to be running-nike-shoes-p456.html for the product called "nike shoes" I tried modifying the Usu_Products.php file to have that. It worked fine for new products I created. However, existing products in the cart do not work like that. Why is that? Quote My Contributions: Google XML Sitemap SEO compatible with Ultimate SEO URL by FWR Media ::: Accurate & Precise Bread Crumb Trail Link to comment Share on other sites More sharing options...
matrix2223 Posted October 4, 2010 Share Posted October 4, 2010 The url rewrites that you all are requesting is like an addon called "pretty urls" for another open source blog/cms. There isn't a free addon for oscommerce to give you such results. The url that you all requesting would be something like www.mysite.com/your category/my cool product That is if I am understanding correctly Quote Link to comment Share on other sites More sharing options...
Wizbits Posted October 4, 2010 Share Posted October 4, 2010 Hi there I have upgraded today a lot of things..., I did a clean install of OSCommerce to v2.2 RCA2a.1 as well as PHP to 5.2.14 this cleaned up a lot of issues I had with some SEO modules..., they are all working well. However I did have loaded Ultimate SEO url 2.2. everthing worked except that when I turned it on I had a loop back between the index.php and manufacturers=id. Anyway in my frustration, I came accross your version 5. I followed the instructions per upgrade from series 2. Everything I installed went well with no errors except the following code for includes/application_top.php Your Code - // ULTIMATE Seo Urls 5 by FWR Media if ( !isset($seo_urls) || !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $SID); } $seo_urls->initiate($SID, $languages_id, $language); I had to do the following so my page could be seen - // ULTIMATE Seo Urls 5 by FWR Media if ( !isset($seo_urls) || !is_object($seo_urls) ){ include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php'; $seo_urls = new usu($languages_id, $request_type, $session_started, $SID); $seo_urls->initiate($SID, $languages_id, $language); } I have had no errors on my install, on removing the 2.2 module. However The new path is not being written..., i've looked and looked and looked and can't see where I am out..., any suggestions where to start or info you would need to look at would be greatly appreciated I await Andy Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 5, 2010 Author Share Posted October 5, 2010 (edited) Hi there Everything I installed went well with no errors except the following code for includes/application_top.php I have had no errors on my install, on removing the 2.2 module. However The new path is not being written..., i've looked and looked and looked and can't see where I am out..., any suggestions where to start or info you would need to look at would be greatly appreciated I await Andy You don't need to change any code USU5 works and has no known issues ( excepting a cache issue on enormous shops which I have a patch for ). If installed correctly it will work if installed incorrectly it will break but nothing in between, it will never do "nothing". Have you added the changed tep_href_link() code to includes/functions/html_output.php? Have you turned it on in admin? Have you run the installer file? Edited October 5, 2010 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 5, 2010 Author Share Posted October 5, 2010 Have installed this mod to OSC to CSS ver 2.0. Have read your thread and there were many post regarding the rewrite mod. In the standard settings, the URL displays as in your instructions. As you can see below but while at product_listing, URL includes index.php: Now go to admin settings, I change standard to rewrite and insert the below in /osc_to_css/.htaccess: # http://www.greatdisc...com/osc_to_css/ = rewritebase /osc_to_css/ RewriteBase /osc_to_css/ and edit the line of code located in /osc_to_css/includes/modules/ultimate_seo_urls5/includes/Usu_Init.php to: // Options rewrite and standard ( rewrite requires mods to .htaccess) @define( 'SEO_URLS_TYPE', 'rewrite' ); // Recommended rewrite The admin settings is as following: And so after changing to rewrite, now when I select any category, I get the 404 Error page. Why are you manually changing the init file? you should have run the installer and be running settings via admin. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
spoofy Posted October 5, 2010 Share Posted October 5, 2010 Hey FWR Media: I have a question for you. I create a separate column in products table in database. I will be using this column for url title. Here is what I mean: Current setup: The product name is included in the url with p-123 so basically nike-shoes-p-456.html for a product called "nike shoes" What I would like to do is this: Leave the product name "nike shoes" however, the url title (slug) will be "running nike shoes". My database column already has this. I would like the url to be running-nike-shoes-p456.html for the product called "nike shoes" I tried modifying the Usu_Products.php file to have that. It worked fine for new products I created. However, existing products in the cart do not work like that. Why is that? Quote My Contributions: Google XML Sitemap SEO compatible with Ultimate SEO URL by FWR Media ::: Accurate & Precise Bread Crumb Trail Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 5, 2010 Author Share Posted October 5, 2010 Hey FWR Media: I have a question for you. I create a separate column in products table in database. I will be using this column for url title. Here is what I mean: Current setup: The product name is included in the url with p-123 so basically nike-shoes-p-456.html for a product called "nike shoes" What I would like to do is this: Leave the product name "nike shoes" however, the url title (slug) will be "running nike shoes". My database column already has this. I would like the url to be running-nike-shoes-p456.html for the product called "nike shoes" I tried modifying the Usu_Products.php file to have that. It worked fine for new products I created. However, existing products in the cart do not work like that. Why is that? If new products work but old remain the same then I'd imagine that you didn't reset the cache. I can't comment otherwise on the functionality as it is obviously non standard. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
spoofy Posted October 5, 2010 Share Posted October 5, 2010 If new products work but old remain the same then I'd imagine that you didn't reset the cache. I can't comment otherwise on the functionality as it is obviously non standard. I have tried resetting the cache via the setting of "true" and also by emptying the mysql table. Nothing seems to be working. Did I miss anywhere else it needs to be cleared? Quote My Contributions: Google XML Sitemap SEO compatible with Ultimate SEO URL by FWR Media ::: Accurate & Precise Bread Crumb Trail Link to comment Share on other sites More sharing options...
Wizbits Posted October 5, 2010 Share Posted October 5, 2010 You don't need to change any code USU5 works and has no known issues ( excepting a cache issue on enormous shops which I have a patch for ). If installed correctly it will work if installed incorrectly it will break but nothing in between, it will never do "nothing". Have you added the changed tep_href_link() code to includes/functions/html_output.php? Have you turned it on in admin? Have you run the installer file? Quote Link to comment Share on other sites More sharing options...
Wizbits Posted October 5, 2010 Share Posted October 5, 2010 Hi Robert Thanks for your reply..., I very slowley went over my install instructions and ensured I had done everything by the book..., yes I did every step with the correct files, files have been removed where necessary and database has been update etc.., My problem is my application.top file and I am lost. I will list below my original application.top file. When I add your code I do receive the path being written correctly but when I click on any product I receive a web 404 error..., as soon as I turn it off my product comes back! Many thanks Andy ------------------------------- ?php /* $Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // start the timer for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); // set the level of error reporting error_reporting(E_ALL & ~E_NOTICE); // check if register_globals is enabled. // since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized. if (function_exists('ini_get')) { ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.'); } // Set the local configuration parameters - mainly for developers if (file_exists('includes/local/configure.php')) include('includes/local/configure.php'); // include server parameters require('includes/configure.php'); if (strlen(DB_SERVER) < 1) { if (is_dir('install')) { header('Location: install/index.php'); } } // define the project version define('PROJECT_VERSION', 'osCommerce 2.2-MS2'); // set the type of request (secure or not) $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; // set php_self in the local scope if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; if ($request_type == 'NONSSL') { define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG); } else { define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG); } // include the list of project filenames require(DIR_WS_INCLUDES . 'filenames.php'); // include the list of project database tables require(DIR_WS_INCLUDES . 'database_tables.php'); // include the IP Trap require(DIR_WS_INCLUDES . 'secret.php'); // customization for the design layout define('BOX_WIDTH', 221); // how wide the boxes should be in pixels (default: 125) define('BOX_WIDTH2', 185); // how wide the boxes should be in pixels (default: 125) // include the database functions require(DIR_WS_FUNCTIONS . 'database.php'); // make a connection to the database... now tep_db_connect() or die('Unable to connect to database server!'); // set the application parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } // FWR Media Security Pro if ( defined('FWR_SECURITY_PRO_ON') && FWR_SECURITY_PRO_ON === 'true' ) { $fwr_security_excludes = array(); if ( defined('FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON') && FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON === 'true' ) $fwr_security_excludes = explode(',', FWR_SECURITY_PRO_FILE_EXCLUSIONS); if ( !in_array(basename($_SERVER['PHP_SELF']), $fwr_security_excludes) ) include('includes/functions/security.php'); } if ( function_exists('tep_clean_get__recursive') ) { // Recursively clean $HTTP_GET_VARS and $_GET // There is no legitimate reason for these to contain anything but .. // A-Z a-z 0-9 -(hyphen).(dot)_(underscore) {} space $HTTP_GET_VARS = tep_clean_get__recursive($HTTP_GET_VARS); $_GET = tep_clean_get__recursive($_GET); $_REQUEST = $_GET + $_POST; // $_REQUEST now holds the cleaned $_GET and std $_POST. $_COOKIE has been removed. fwr_clean_global($_GET); // Change the $GLOBALS value to the cleaned value } // END - FWR Media Security Pro // if gzip_compression is enabled, start to buffer the output if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) { if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) { if (PHP_VERSION >= '4.0.4') { ob_start('ob_gzhandler'); } else { include(DIR_WS_FUNCTIONS . 'gzip_compression.php'); ob_start(); ob_implicit_flush(); } } else { ini_set('zlib.output_compression_level', GZIP_LEVEL); } } // set the HTTP GET parameters manually if search_engine_friendly_urls is enabled if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { if (strlen(getenv('PATH_INFO')) > 1) { $GET_array = array(); $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF); $vars = explode('/', substr(getenv('PATH_INFO'), 1)); for ($i=0, $n=sizeof($vars); $i<$n; $i++) { if (strpos($vars[$i], '[]')) { $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1]; } else { $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1]; } $i++; } if (sizeof($GET_array) > 0) { while (list($key, $value) = each($GET_array)) { $HTTP_GET_VARS[$key] = $value; } } } } // define general functions used application-wide require(DIR_WS_FUNCTIONS . 'general.php'); require(DIR_WS_FUNCTIONS . 'html_output.php'); // set the cookie domain $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN); $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH); // include cache functions if enabled if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php'); // include shopping cart class require(DIR_WS_CLASSES . 'shopping_cart.php'); // include navigation history class require(DIR_WS_CLASSES . 'navigation_history.php'); // some code to solve compatibility issues require(DIR_WS_FUNCTIONS . 'compatibility.php'); // check if sessions are supported, otherwise use the php3 compatible session class if (!function_exists('session_start')) { define('PHP_SESSION_NAME', 'osCsid'); define('PHP_SESSION_PATH', $cookie_path); define('PHP_SESSION_DOMAIN', $cookie_domain); define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY); include(DIR_WS_CLASSES . 'sessions.php'); } // define how the session functions will be used require(DIR_WS_FUNCTIONS . 'sessions.php'); // set the session name and save path tep_session_name('osCsid'); tep_session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, $cookie_path, $cookie_domain); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_domain', $cookie_domain); } // set the session ID if it exists if (isset($HTTP_POST_VARS[tep_session_name()])) { tep_session_id($HTTP_POST_VARS[tep_session_name()]); } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) { tep_session_id($HTTP_GET_VARS[tep_session_name()]); } // start the session $session_started = false; if (SESSION_FORCE_COOKIE_USE == 'True') { tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain); if (isset($HTTP_COOKIE_VARS['cookie_test'])) { tep_session_start(); $session_started = true; } } elseif (SESSION_BLOCK_SPIDERS == 'True') { $user_agent = strtolower(getenv('HTTP_USER_AGENT')); $spider_flag = false; if (tep_not_null($user_agent)) { $spiders = file(DIR_WS_INCLUDES . 'spiders.txt'); for ($i=0, $n=sizeof($spiders); $i<$n; $i++) { if (tep_not_null($spiders[$i])) { if (is_integer(strpos($user_agent, trim($spiders[$i])))) { $spider_flag = true; break; } } } } if ($spider_flag == false) { tep_session_start(); $session_started = true; } } else { tep_session_start(); $session_started = true; } // set SID once, even if empty $SID = (defined('SID') ? SID : ''); // verify the ssl_session_id if the feature is enabled if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) { $ssl_session_id = getenv('SSL_SESSION_ID'); if (!tep_session_is_registered('SSL_SESSION_ID')) { $SESSION_SSL_ID = $ssl_session_id; tep_session_register('SESSION_SSL_ID'); } if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } } // verify the browser user agent if the feature is enabled if (SESSION_CHECK_USER_AGENT == 'True') { $http_user_agent = getenv('HTTP_USER_AGENT'); if (!tep_session_is_registered('SESSION_USER_AGENT')) { $SESSION_USER_AGENT = $http_user_agent; tep_session_register('SESSION_USER_AGENT'); } if ($SESSION_USER_AGENT != $http_user_agent) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_LOGIN)); } } // verify the IP address if the feature is enabled if (SESSION_CHECK_IP_ADDRESS == 'True') { $ip_address = tep_get_ip_address(); if (!tep_session_is_registered('SESSION_IP_ADDRESS')) { $SESSION_IP_ADDRESS = $ip_address; tep_session_register('SESSION_IP_ADDRESS'); } if ($SESSION_IP_ADDRESS != $ip_address) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_LOGIN)); } } // create the shopping cart & fix the cart if necesary if (tep_session_is_registered('cart') && is_object($cart)) { if (PHP_VERSION < 4) { $broken_cart = $cart; $cart = new shoppingCart; $cart->unserialize($broken_cart); } } else { tep_session_register('cart'); $cart = new shoppingCart; } // include currencies class and create an instance require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); // include the mail classes require(DIR_WS_CLASSES . 'mime.php'); require(DIR_WS_CLASSES . 'email.php'); // set the language if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) { if (!tep_session_is_registered('language')) { tep_session_register('language'); tep_session_register('languages_id'); } include(DIR_WS_CLASSES . 'language.php'); $lng = new language(); if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) { $lng->set_language($HTTP_GET_VARS['language']); } else { $lng->get_browser_language(); } $language = $lng->language['directory']; $languages_id = $lng->language['id']; } // include the language translations require(DIR_WS_LANGUAGES . $language . '.php'); // currency if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) { if (!tep_session_is_registered('currency')) tep_session_register('currency'); if (isset($HTTP_GET_VARS['currency'])) { if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } else { $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } } if (!$_SESSION['currency']) { $currency = "CAD"; tep_session_register('currency');} // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); // Shopping cart actions if (isset($HTTP_GET_VARS['action'])) { // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } switch ($HTTP_GET_VARS['action']) { // customer wants to update the product quantity in their shopping cart case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) { if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) { $cart->remove($HTTP_POST_VARS['products_id'][$i]); } else { if (PHP_VERSION < 4) { // if PHP3, make correction for lack of multidimensional array. reset($HTTP_POST_VARS); while (list($key, $value) = each($HTTP_POST_VARS)) { if (is_array($value)) { while (list($key2, $value2) = each($value)) { if (ereg ("(.*)\]\[(.*)", $key2, $var)) { $id2[$var[1]][$var[2]] = $value2; } } } } $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : ''; } else { $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : ''; } $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; case 'notify' : if (tep_session_is_registered('customer_id')) { if (isset($HTTP_GET_VARS['products_id'])) { $notify = $HTTP_GET_VARS['products_id']; } elseif (isset($HTTP_GET_VARS['notify'])) { $notify = $HTTP_GET_VARS['notify']; } elseif (isset($HTTP_POST_VARS['notify'])) { $notify = $HTTP_POST_VARS['notify']; } else { tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] < 1) { tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())"); } } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] > 0) { tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'])); } else { $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; } } // include the who's online functions require(DIR_WS_FUNCTIONS . 'whos_online.php'); tep_update_whos_online(); // include the password crypto functions require(DIR_WS_FUNCTIONS . 'password_funcs.php'); // include validation functions (right now only email address) require(DIR_WS_FUNCTIONS . 'validations.php'); // split-page-results require(DIR_WS_CLASSES . 'split_page_results.php'); // infobox require(DIR_WS_CLASSES . 'boxes.php'); // auto activate and expire banners require(DIR_WS_FUNCTIONS . 'banner.php'); tep_activate_banners(); tep_expire_banners(); // auto expire special products require(DIR_WS_FUNCTIONS . 'specials.php'); tep_expire_specials(); // calculate category path if (isset($HTTP_GET_VARS['cPath'])) { $cPath = $HTTP_GET_VARS['cPath']; } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) { $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']); } else { $cPath = ''; } if (tep_not_null($cPath)) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; } else { $current_category_id = 0; } // 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); $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); // add category names or the manufacturer name to the breadcrumb trail if (isset($cPath_array)) { for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) { $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'"); if (tep_db_num_rows($categories_query) > 0) { $categories = tep_db_fetch_array($categories_query); $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } else { break; } } } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) { $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); if (tep_db_num_rows($manufacturers_query)) { $manufacturers = tep_db_fetch_array($manufacturers_query); $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'])); } } // add the products model to the breadcrumb trail if (isset($HTTP_GET_VARS['products_id'])) { $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); if (tep_db_num_rows($model_query)) { $model = tep_db_fetch_array($model_query); $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id'])); } } // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; // set which precautions should be checked define('WARN_INSTALL_EXISTENCE', 'true'); define('WARN_CONFIG_WRITEABLE', 'true'); define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true'); define('WARN_SESSION_AUTO_START', 'true'); define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'); // Start - CREDIT CLASS Gift Voucher Contribution require(DIR_WS_INCLUDES . 'add_ccgvdc_application_top.php'); // End - CREDIT CLASS Gift Voucher Contribution ?> Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 5, 2010 Author Share Posted October 5, 2010 Hi Robert Thanks for your reply..., I very slowley went over my install instructions and ensured I had done everything by the book..., yes I did every step with the correct files, files have been removed where necessary and database has been update etc.., My problem is my application.top file and I am lost. I will list below my original application.top file. When I add your code I do receive the path being written correctly but when I click on any product I receive a web 404 error..., as soon as I turn it off my product comes back! Many thanks Andy No please do not post entire files here, it makes the support topic unreadable for others. Just to reiterate USU5 has no major code issues so it is pointless to look for them. I will list below my original application.top file. When I add your code I do receive the path being written correctly but when I click on any product I receive a web 404 error..., as soon as I turn it off my product comes back! If this happens with the standard settings then you are on a server that doesn't accept path based uris .. e.g. Let's say your site url is www.mysite.com/catalog/ If you try to access the site as www.mysite.com/catalog/index.php/test Do you get an FWR Media 404, a site 404 or do you see the correct page? Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
blr044 Posted October 5, 2010 Share Posted October 5, 2010 Why are you manually changing the init file? you should have run the installer and be running settings via admin. With the settings in ADMIN set at rewrite and the rewrite inserted in .htaccess, at /osc_to_css/ because that's the location of the test store, I would get page not found whenever I clicked a category. That's why I did that, but still it did not change anything, so I changed it back to the way it was. Install was very easy and I did run the installer. Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 5, 2010 Author Share Posted October 5, 2010 (edited) With the settings in ADMIN set at rewrite and the rewrite inserted in .htaccess, at /osc_to_css/ because that's the location of the test store, I would get page not found whenever I clicked a category. That's why I did that, but still it did not change anything, so I changed it back to the way it was. Install was very easy and I did run the installer. Then very simply your server is not set up correctly for RewriteRules. Try replacing Options +FollowSymLinks with Options +SymLinksIfOwnerMatch If that doesn't work .. Occasionally commenting out .. #Options +FollowSymLinks in .htaccess works due to httpd.conf settings. Is mod_rewrite compiled in apache? AllowOverride in httpd.conf allows or disallows settings in .htaccess "ALL" is a pretty standard setting. Updated this post a few times Edited October 5, 2010 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 5, 2010 Author Share Posted October 5, 2010 (edited) Security Notice Actually the above post reminded me that I had intended a security post.. a point for everyone using USU5 and potentially any url rewriter There has been a notice that Options +FollowSymLinks In certain circumstances can provide a security breach. In .htaccess try replacing Options +FollowSymLinks with Options +SymLinksIfOwnerMatch If it works then fantastic .. if not you'll have to stay with Options +FollowSymLinks Edited October 5, 2010 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.