{"id":24,"date":"2006-01-29T17:32:04","date_gmt":"2006-01-29T16:32:04","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=24"},"modified":"2011-04-30T10:22:44","modified_gmt":"2011-04-30T09:22:44","slug":"surviving-the-weekend-my-way","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2006\/01\/surviving-the-weekend-my-way\/","title":{"rendered":"surviving the weekend &#8211; my way."},"content":{"rendered":"<p>friday afternoon. i managed to escape from work at ~5.3o pm. could \u2018ve been worse. went home and hunted for my customers. it\u2019s a strategical moment&#8230; either i can be buried in work for next one week, be work-less and sentenced to spend weekend not doing anything or &#8211; as in this case &#8211; gather requirements for some small tasks that perfectly fit in next two days. later on i went out for few hours to meet few people from work in some not-very-noisy club\/pub in the city, had two ciders, went back home. great thing about sweeden: smoking is banned in all restaurants\/clubs\/pubs. no more wear once\/wash immediately clothes problem. <\/p>\n<p>falling asleep at 11pm on friday night is .. at least inappropriate. i\u2019ve done 1\/3rd of weekend tasks. goal: make links to products and categories at <a href=\"http:\/\/polphone.com\/\">polphone.com<\/a> google-friendly. what is it about? optimizing any e-commerce website to be crawler friendly become necessity nowadays &#8211; most of customer come to web-shops from google\/yahoo\/msn search result page. the higher in results of search page is, the more sub-pages gets indexed and re-indexed quickly &#8211; the more potential customers will visit the site. a very basic, and considered as ethical, method of <a href=\"http:\/\/en.wikipedia.org\/wiki\/SEO\">SEO<\/a> is removing question marks from all links to pages generated on the fly. search engines tend to be very reluctant when it comes to crawling links that pass arguments after question mark. why? chances are that part of arguments might be unique session id &#8211; in result search engine will discover every time different urls leading to the same content [typical example of not-google-friendly site can be any out-of-the box <a href=\"http:\/\/phpbb.com\/\">phpbb<\/a> or <a href=\"http:\/\/www.oscommerce.com\/\">oscommerce<\/a> installation with links like: profile.php?mode=register&#038;sid=b0848457086214339e74ce4ceca6f7eb]. <\/p>\n<p>so one more time &#8211; in my case &#8211; goal was to transform product.php?id=123 links into p123_something_something.php while keeping all the page generated dynamically based on database of products and categories. my way of solving problem was pretty lazy [or in corporate language: efficient] &#8211; based on .htaccess file &#8211; i just addedd single line to it:<\/p>\n<pre class=\"prettyprint\">\r\nErrorDoc 404 \/u\/error.php\r\n<\/pre>\n<p>the outcome? any request that points to non-exsiting file\/script will be dispatched by my script called error.php. in this script &#8211; as one of elements of $_SERVER array i\u2019ll get whole url. i can parse it and take product id out of it as below:<\/p>\n<pre class=\"prettyprint\">\r\n        header(\"HTTP\/1.1 200 OK\");\r\n        \/\/ if file part of url starts with 'p' it should be treated as product page\r\n        if (strstr(@$_SERVER['PATH_REDIRECTED'],\"\/p\")!=false){    \r\n                $i = explode(\"\/p\",@$_SERVER['PATH_REDIRECTED']);\r\n                $i = explode(\"_\",@$i[1]);\r\n                $i = $i[0];\r\n \r\n                $_REQUEST['id']=$i;\r\n                include(\"product.php\"); \/\/ invoke 'old' product.php handler\r\n                die();\r\n        }\r\n\/\/\r\n\/\/ i used similar approach for categories\r\n<\/pre>\n<p>saturday .. nice url\u2019s are running fine. one gets the same content displayed both when invokes product.php?id=123 and p123_whatever.php. last step in this task is navigation re-work. i needed to change all links generated on different pages from product.php?id={$p.id} to p{$p.id}_whatever.php. site is template drive so no other changes in php code were required.<\/p>\n<p>btw &#8211; few months ago i\u2019ve done similar process to \u2018fix\u2019 techgsm.com. you never know what is the cause of increased number of hits website gets: better advertising on peer sites, higher position on google or just pure luck. anyway &#8211; hit counter is running even quicker right now :-]<\/p>\n<p>in the afternoon i took some fresh air, had a walk, got back home, resurrected some failing server @ work and got back on my weekend track: started to gather requirements for next weekend jobs while studying google sitemaps. in contrary to \u2018google-friendly\u2019 links case i\u2019m first timer when it comest to sitemaps. we\u2019ll see if it really gives any benefit. idea is simple: publish xml containing list of all cruicial subpages and date of last modification, let google know about it and hope it will visit newly updated\/created pages much quicker.<\/p>\n<p>lazy sunday: to the usual ritual [ wake up\u2192computer\u2192church\u2192computer\u2192shave\u2192wash\u2192sleep] i\u2019ve added swimming pool. to mk sunday less lazy [or in other words to catch another deadline] i\u2019ve migrated 223 e-mail accounts from one server to another for multicon \/ gdansk&#8230; hopefully within next few days\/weeks i\u2019ll put somewhere here my recipe for fully blown mail server with sql based accounts management \/ antispam \/ antivir filters based on postfix.<\/p>\n<p>more info on SEO can be found here:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.sitepoint.com\/article\/search-engine-friendly-urls\">http:\/\/www.sitepoint.com\/article\/search-engine-friendly-urls<\/a><\/li>\n<li><a href=\"http:\/\/evolt.org\/node\/15049\">http:\/\/evolt.org\/node\/15049<\/a><\/li>\n<li><a href=\"http:\/\/www.iceteks.com\/articles.php\/sefriendlylinks\/1\">http:\/\/www.iceteks.com\/articles.php\/sefriendlylinks\/1<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>friday afternoon. i managed to escape from work at ~5.3o pm. could \u2018ve been worse. went home and hunted for my customers. it\u2019s a strategical moment&#8230; either i can be buried in work for next one week, be work-less and sentenced to spend weekend not doing anything or &#8211; as in this case &#8211; gather [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,17],"tags":[3],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-non-tech","category-tech","tag-old-stuff"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":8,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":621,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/24\/revisions\/621"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}