<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Script Solution&#187; url</title>
	<atom:link href="http://www.openscriptsolution.com/tag/url/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Remove a Trailing Slash from Home&#8217;s URL in Atahualpa 3.5.3 Theme of WordPress</title>
		<link>http://www.openscriptsolution.com/2010/08/10/how-to-remove-a-trailing-slash-from-homes-url-in-atahualpa-353-theme-of-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2010/08/10/how-to-remove-a-trailing-slash-from-homes-url-in-atahualpa-353-theme-of-wordpress/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 03:12:23 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Atahualpa]]></category>
		<category><![CDATA[beranda]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[trailing slash]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[WPML]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1259</guid>
		<description><![CDATA[Believe it or not, if you are running a multilingual site using Atahualpa theme and WPML plugin, you will find that there is a double trailing slash in the Home&#8217;s URL that generated by WPML, especially for Home&#8217;s URL belongs to the languages other than the default one and you are using the &#8220;directory per [...]]]></description>
			<content:encoded><![CDATA[<p>Believe it or not, if you are running a multilingual site using <a href="http://wordpress.bytesforall.com/" title="Atahualpa" target="_blank">Atahualpa</a> theme and <a href="http://wpml.org" title="WPML" target="_blank">WPML</a> plugin, you will find that there is a double trailing slash in the Home&#8217;s URL that generated by WPML, especially for Home&#8217;s URL belongs to the languages other than the default one and you are using the &#8220;directory per language&#8221; setting in WPML. This can be happened since Atahualpa add a trailing slash in every Home&#8217;s URL when the home page is being displayed, whereas WPML also added another trailing slash after the language code in the URL. So, this will make a double trailing slash in the Home&#8217;s URL. In order to remove one of these trailing slash, you can use this following modification. As time goes by, this modification being applied into Atahualpa version 3.5.3 (the last version while I was writing this article) and WordPress version 3.0.1. I am not sure whether this modification can be applied into the older versions. <span id="more-1259"></span></p>
<ol>
<li>
Open your <strong>/wp-content/themes/{youratahualpathemename}/bfa_header_config.php</strong> file, and find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'/&quot;</span></pre></div></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&quot;</span></pre></div></div>

<p>Please note that part of code located in six different location at that file, so you have to replace it six times.
</li>
<li>
Open your <strong>/wp-content/themes/{youratahualpathemename}/bfa_footer.php</strong> file, and find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'/&quot;</span></pre></div></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&quot;</span></pre></div></div>

</li>
<li>
Open your <strong>/wp-content/themes/{youratahualpathemename}/bfa_next_previous_links.php</strong> file, and find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'/&quot;</span></pre></div></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&quot;</span></pre></div></div>

<p>Please note that part of code located in three different location at that file, so you have to replace it three times.
</li>
</ol>
<p>That&#8217;s all. Now you should have the proper Home&#8217;s URL according to their own languages.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F08%2F10%2Fhow-to-remove-a-trailing-slash-from-homes-url-in-atahualpa-353-theme-of-wordpress%2F&amp;title=How%20to%20Remove%20a%20Trailing%20Slash%20from%20Home%26%238217%3Bs%20URL%20in%20Atahualpa%203.5.3%20Theme%20of%20WordPress" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/08/10/how-to-remove-a-trailing-slash-from-homes-url-in-atahualpa-353-theme-of-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Adjust Home URL Properly in Breadcrumb NavXT Plugin If You Are Running Multilingual Site</title>
		<link>http://www.openscriptsolution.com/2010/07/28/how-to-adjust-home-url-properly-in-breadcrumb-navxt-plugin-if-you-are-running-multilingual-site/</link>
		<comments>http://www.openscriptsolution.com/2010/07/28/how-to-adjust-home-url-properly-in-breadcrumb-navxt-plugin-if-you-are-running-multilingual-site/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 10:07:47 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[beranda]]></category>
		<category><![CDATA[Breadcrumb NavXT]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[multibahasa]]></category>
		<category><![CDATA[multilingual]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1246</guid>
		<description><![CDATA[The modification I made in the article with titled: How To Make Breadcrumb NavXT Plugin Support for Multi Language will make that plugin will support for multilingual site. Unfortunately, the Home link in the breadcrumb (if you display it in the breadcrumb) will give you a result always pointing to the default URL&#8217;s home, and [...]]]></description>
			<content:encoded><![CDATA[<p>The modification I made in the article with titled: <a href="http://www.openscriptsolution.com/2010/04/25/how-to-make-breadcrumb-navxt-plugin-support-for-multi-language/" target="_blank" title="How To Make Breadcrumb NavXT Plugin Support for Multi Language">How To Make Breadcrumb NavXT Plugin Support for Multi Language</a> will make that plugin will support for multilingual site. Unfortunately, the <strong>Home</strong> link in the breadcrumb (if you display it in the breadcrumb) will give you a result always pointing to the default URL&#8217;s home, and not to the home of the selected language. For example, you have a multilingual site which <strong>English</strong> as default language and <strong>Indonesian</strong> as the second language. So, the default of URL&#8217;s home in English is http://www.example.com, and unfortunately the URL&#8217;s home in Indonesian does not change, and still using: http://www.example.com instead of http://www.example.com/id/. In order to overcome this little issue but still annoying me, then this following modification will help you by replacing only two lines of code in the <strong>breadcrumb_navxt_class.php</strong> file belongs to Breadcrumb NavXT plugin. <span id="more-1246"></span></p>
<ol>
<li>
Open your <strong>breadcrumb_navxt_class.php</strong> file, and find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #666666; font-style: italic;">//Figure out the anchor for home page</span>
	<span style="color: #000088;">$breadcrumb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_anchor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'home_anchor'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #666666; font-style: italic;">//Figure out the anchor for home page</span>
	<span style="color: #000088;">$breadcrumb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_anchor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'home_anchor'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>
Still in the same file, find again this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #666666; font-style: italic;">//Deal with the anchor</span>
	<span style="color: #000088;">$breadcrumb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_anchor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'home_anchor'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #666666; font-style: italic;">//Deal with the anchor</span>
	<span style="color: #000088;">$breadcrumb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_anchor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opt</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'home_anchor'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
</ol>
<p>Please note that this modification has been successfully applied on WordPress version 3 or above. Not tested in the older version than that.</p>
<p>Demo:<br />
- <a href="http://www.ilovewordpress.org/category/general/" target="_blank">http://www.ilovewordpress.org/category/general/</a> (English version)<br />
- <a href="http://www.ilovewordpress.org/id/category/umum/" target="_blank">http://www.ilovewordpress.org/id/category/umum/</a> (Indonesian version)</p>
<p>Hope this helps someone out there!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F07%2F28%2Fhow-to-adjust-home-url-properly-in-breadcrumb-navxt-plugin-if-you-are-running-multilingual-site%2F&amp;title=How%20to%20Adjust%20Home%20URL%20Properly%20in%20Breadcrumb%20NavXT%20Plugin%20If%20You%20Are%20Running%20Multilingual%20Site" id="wpa2a_4"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/07/28/how-to-adjust-home-url-properly-in-breadcrumb-navxt-plugin-if-you-are-running-multilingual-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Remove CMS ID from URL of PrestaShop version 1.2.5</title>
		<link>http://www.openscriptsolution.com/2010/05/05/how-to-remove-cms-id-from-url-of-prestashop-version-1-2-5/</link>
		<comments>http://www.openscriptsolution.com/2010/05/05/how-to-remove-cms-id-from-url-of-prestashop-version-1-2-5/#comments</comments>
		<pubDate>Wed, 05 May 2010 02:32:28 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[PrestaShop]]></category>
		<category><![CDATA[CMS ID]]></category>
		<category><![CDATA[menghapus]]></category>
		<category><![CDATA[ramah URL]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[SEO Friendly]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1190</guid>
		<description><![CDATA[After implementing the similar modification about how to remove the category and product id from URL of PrestaShop in my last two articles before this current one, now let&#8217;s try to remove also the CMS ID from URL of your PrestaShop. For instance, by default PrestaShop uses the URL for displaying CMS page like: /content/1-delivery [...]]]></description>
			<content:encoded><![CDATA[<p>After implementing the similar modification about how to remove the category and product id from URL of PrestaShop in my last two articles before this current one, now let&#8217;s try to remove also the CMS ID from URL of your PrestaShop. For instance, by default PrestaShop uses the URL for displaying CMS page like: <strong>/content/1-delivery</strong> instead of <strong>/content/delivery</strong>. I have successfully implemented the modification into PrestaShop version 1.2.5. It is recommended that you have also implemented the two similar modification about <a href="http://www.openscriptsolution.com/2010/05/03/how-to-remove-category-id-from-url-of-prestashop-version-1-2-5/" target="_blank">how to remove category id</a> and <a href="http://www.openscriptsolution.com/2010/05/04/how-to-remove-product-id-from-url-of-prestashop-version-1-2-5/" target="_blank">how to remove product id</a> from the URL of your PrestaShop. <span id="more-1190"></span></p>
<ol>
<li>
Make sure that you have already had the .htaccess file in your PrestaShop’s root directory, which has the content like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
&nbsp;
# URL rewriting module activation
RewriteEngine on
&nbsp;
# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop1250/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop1250/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$3&amp;isolang=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$2&amp;isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/category.php?id_category=$2&amp;isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /prestashop1250/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /prestashop1250/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /prestashop1250/$2?isolang=$1 [QSA,L,E]
&nbsp;
# Catch 404 errors
ErrorDocument 404 /prestashop1250/404.php
&nbsp;
# Remove Category ID from URL. You have to modify also the /classes/Link.php file! Modified by Masino Sinaga, May 3, 2010
RewriteRule ^accessories-ipod$ /prestashop1250/category.php?id_category=3 [QSA,L,E]
RewriteRule ^music-ipods$ /prestashop1250/category.php?id_category=2 [QSA,L,E]
RewriteRule ^laptops$ /prestashop1250/category.php?id_category=1 [QSA,L,E]
&nbsp;
# Remove Product ID from URL. You have to modify also the /classes/Link.php file! Modified by Masino Sinaga, May 4, 2010
RewriteRule ^music-ipods/ipod-nano\.html(.*)$ product.php?id_product=1$1 [QSA,L,E]
RewriteRule ^music-ipods/ipod-shuffle\.html(.*)$ product.php?id_product=2$1 [QSA,L,E]
RewriteRule ^laptops/macbook-air\.html(.*)$ product.php?id_product=5$1 [QSA,L,E]
RewriteRule ^laptops/macbook\.html(.*)$ product.php?id_product=6$1 [QSA,L,E]
RewriteRule ^music-ipods/ipod-touch\.html(.*)$ product.php?id_product=7$1 [QSA,L,E]
RewriteRule ^accessories-ipod/housse-portefeuille-en-cuir-belkin-pour-ipod-nano-noir-chocolat\.html(.*)$ product.php?id_product=8$1 [QSA,L,E]
RewriteRule ^accessories-ipod/ecouteurs-a-isolation-sonore-shure-se210-blanc\.html(.*)$ product.php?id_product=9$1 [QSA,L,E]</pre></div></div>

<p>Actually, those content of .htaccess we get from the previous two modification from the two links above. You can generate this .htaccess file from admin panel at <strong>Tools</strong> tab, then choose <strong>Generators</strong> sub-tab, and follow the instructions carefully there. In this example above, I use <strong>prestashop1250</strong> for the domain name. Please adjust it with yours.
</li>
<li>
Add this following code after the last line of that code above:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># Remove CMS ID from URL. You have to modify also the /classes/Link.php file! Modified by Masino Sinaga, May 5, 2010
RewriteRule ^content/delivery$ cms.php?id_cms=1$1 [QSA,L,E]
RewriteRule ^content/legal-notice$ cms.php?id_cms=2$1 [QSA,L,E]
RewriteRule ^content/terms-and-conditions-of-use$ cms.php?id_cms=3$1 [QSA,L,E]
RewriteRule ^content/about-us$ cms.php?id_cms=4$1 [QSA,L,E]
RewriteRule ^content/secure-payment$ cms.php?id_cms=5$1 [QSA,L,E]</pre></div></div>

<p>It meant that we will adjust the URL for 5 CMS pages: delivery, legal-notice, terms-and-conditions-of-use, about-us, and secure-payment. In other words, if you have more than 5 CMS pages, you have to define or add again your own CMS one by one into the .htaccess file.
</li>
<li>
Open your <strong>/classes/Link.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>61
62
63
64
65
66
67
68
69
70
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCMSLink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'content/'</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$cms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link_rewrite</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'cms.php?id_cms='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'content/'</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'cms.php?id_cms='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'cms.php?id_cms='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>61
62
63
64
65
66
67
68
69
70
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCMSLink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'content/'</span><span style="color: #666666; font-style: italic;">/*.intval($cms-&gt;id).'-'*/</span><span style="color: #339933;">.</span><span style="color: #000088;">$cms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link_rewrite</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'cms.php?id_cms='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'content/'</span><span style="color: #666666; font-style: italic;">/*.intval($cms).'-'*/</span><span style="color: #339933;">.</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'cms.php?id_cms='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'cms.php?id_cms='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cms</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Now you should have the URL without CMS ID in it.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F05%2F05%2Fhow-to-remove-cms-id-from-url-of-prestashop-version-1-2-5%2F&amp;title=How%20to%20Remove%20CMS%20ID%20from%20URL%20of%20PrestaShop%20version%201.2.5" id="wpa2a_6"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/05/05/how-to-remove-cms-id-from-url-of-prestashop-version-1-2-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Remove Product ID from URL of PrestaShop version 1.2.5</title>
		<link>http://www.openscriptsolution.com/2010/05/04/how-to-remove-product-id-from-url-of-prestashop-version-1-2-5/</link>
		<comments>http://www.openscriptsolution.com/2010/05/04/how-to-remove-product-id-from-url-of-prestashop-version-1-2-5/#comments</comments>
		<pubDate>Tue, 04 May 2010 03:38:46 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[PrestaShop]]></category>
		<category><![CDATA[category id]]></category>
		<category><![CDATA[hapus]]></category>
		<category><![CDATA[product id]]></category>
		<category><![CDATA[ramah URL]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[SEO in PrestaShop]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[URL Friendly]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1186</guid>
		<description><![CDATA[Have you ever wanted to remove the product id from the URL of your PrestaShop? For instance, by default, PrestaShop uses this URL to display the certain product named ipod-touch: /7-ipod-touch.html instead of /ipod-touch.html. Well, here is the solution how you can make it comes true. I have successfully implemented it into PrestaShop version 1.2.5. [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to remove the product id from the URL of your PrestaShop? For instance, by default, PrestaShop uses this URL to display the certain product named ipod-touch: <strong>/7-ipod-touch.html</strong> instead of <strong>/ipod-touch.html</strong>. Well, here is the solution how you can make it comes true. I have successfully implemented it into PrestaShop version 1.2.5. Please note that before you implement this modification, make sure you have already implemented the similar modification that will <a href="http://www.openscriptsolution.com/2010/05/03/how-to-remove-category-id-from-url-of-prestashop-version-1-2-5/" target="_blank">remove category id</a> from the URL. <span id="more-1186"></span></p>
<ol>
<li>
Make sure that you have already had the <strong>.htaccess</strong> file in your PrestaShop&#8217;s root directory, which has the content like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
&nbsp;
# URL rewriting module activation
RewriteEngine on
&nbsp;
# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop1250/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop1250/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$3&amp;isolang=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$2&amp;isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/category.php?id_category=$2&amp;isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /prestashop1250/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /prestashop1250/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /prestashop1250/$2?isolang=$1 [QSA,L,E]
&nbsp;
# Catch 404 errors
ErrorDocument 404 /prestashop1250/404.php
&nbsp;
# Remove Category ID from URL. You have to modify also the /classes/Link.php file! Modified by Masino Sinaga, May 3, 2010
RewriteRule ^accessories-ipod$ /prestashop1250/category.php?id_category=3 [QSA,L,E]
RewriteRule ^music-ipods$ /prestashop1250/category.php?id_category=2 [QSA,L,E]
RewriteRule ^laptops$ /prestashop1250/category.php?id_category=1 [QSA,L,E]</pre></div></div>

<p>That <strong>.htaccess</strong> file is generated from the link I mentioned above about. You can generate this .htaccess file from admin panel at <strong>Tools</strong> tab, then choose <strong>Generators</strong> sub-tab, and follow the instructions carefully there. In this example above, I use <strong>prestashop1250</strong> for the domain name. Please adjust it with yours.
</li>
<li>
Add this following code after the last line of that code above:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># Remove Product ID from URL. You have to modify also the /classes/Link.php file! Modified by Masino Sinaga, May 4, 2010
RewriteRule ^music-ipods/ipod-nano\.html(.*)$ product.php?id_product=1$1 [QSA,L,E]
RewriteRule ^music-ipods/ipod-shuffle\.html(.*)$ product.php?id_product=2$1 [QSA,L,E]
RewriteRule ^laptops/macbook-air\.html(.*)$ product.php?id_product=5$1 [QSA,L,E]
RewriteRule ^laptops/macbook\.html(.*)$ product.php?id_product=6$1 [QSA,L,E]
RewriteRule ^music-ipods/ipod-touch\.html(.*)$ product.php?id_product=7$1 [QSA,L,E]
RewriteRule ^accessories-ipod/housse-portefeuille-en-cuir-belkin-pour-ipod-nano-noir-chocolat\.html(.*)$ product.php?id_product=8$1 [QSA,L,E]
RewriteRule ^accessories-ipod/ecouteurs-a-isolation-sonore-shure-se210-blanc\.html(.*)$ product.php?id_product=9$1 [QSA,L,E]</pre></div></div>

<p>It meant that we will adjust the 7 products name: ipod-nano, ipod-shuffle, macbook-air, macbook, ipod-touch, housse-portefeuille-en-cuir-belkin-pour-ipod-nano-noir-chocolat, and ecouteurs-a-isolation-sonore-shure-se210-blanc. In other words, if you have more than 7 products above, you have to define or add your own product one by one into the .htaccess file.
</li>
<li>
Open your <strong>/classes/Link.php</strong> file, find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getProductLink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ean13</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	 	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">category</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'home'</span> AND <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">category</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">category</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link_rewrite</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ean13</span> ? <span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ean13</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.html'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'product.php?id_product='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$category</span> AND <span style="color: #000088;">$category</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span><span style="color: #000088;">$category</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alias</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ean13</span> ? <span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$ean13</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.html'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'product.php?id_product='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #b1b100;">return</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'product.php?id_product='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getProductLink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ean13</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	 	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">category</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'home'</span> AND <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">category</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">category</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #666666; font-style: italic;">/*intval($id_product-&gt;id).'-'.*/</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link_rewrite</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ean13</span> ? <span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ean13</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.html'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'product.php?id_product='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>?<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$category</span> AND <span style="color: #000088;">$category</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span><span style="color: #000088;">$category</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #666666; font-style: italic;">/*intval($id_product).'-'.*/</span><span style="color: #000088;">$alias</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ean13</span> ? <span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$ean13</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.html'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'product.php?id_product='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #b1b100;">return</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'product.php?id_product='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_product</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Now you should have the URL without the category and product id in it.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F05%2F04%2Fhow-to-remove-product-id-from-url-of-prestashop-version-1-2-5%2F&amp;title=How%20to%20Remove%20Product%20ID%20from%20URL%20of%20PrestaShop%20version%201.2.5" id="wpa2a_8"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/05/04/how-to-remove-product-id-from-url-of-prestashop-version-1-2-5/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to Remove Category ID from URL of PrestaShop version 1.2.5</title>
		<link>http://www.openscriptsolution.com/2010/05/03/how-to-remove-category-id-from-url-of-prestashop-version-1-2-5/</link>
		<comments>http://www.openscriptsolution.com/2010/05/03/how-to-remove-category-id-from-url-of-prestashop-version-1-2-5/#comments</comments>
		<pubDate>Mon, 03 May 2010 10:10:27 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[PrestaShop]]></category>
		<category><![CDATA[category id]]></category>
		<category><![CDATA[id kategori]]></category>
		<category><![CDATA[menghapus]]></category>
		<category><![CDATA[ramah URL]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[SEO in PrestaShop]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[URL Friendly]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1183</guid>
		<description><![CDATA[This following modification will remove the category id from the URL of your PrestaShop. As we know, by default, PrestaShop uses the URL for category such as: /3-accessories-ipod instead of accessories-ipod. Please note that you have to enable the URL Friendly feature that you can set it up from the Preferences tab in admin panel [...]]]></description>
			<content:encoded><![CDATA[<p>This following modification will remove the category id from the URL of your PrestaShop. As we know, by default, PrestaShop uses the URL for category such as: <strong>/3-accessories-ipod</strong> instead of <strong>accessories-ipod</strong>. Please note that you have to enable the <strong>URL Friendly</strong> feature that you can set it up from the <strong>Preferences</strong> tab in admin panel by choosing the <strong>Yes</strong> option in order to implement this modification. I have successfully applied this modification into PrestaShop version 1.2.5 (the stable version until I wrote this current article). <span id="more-1183"></span></p>
<ol>
<li>
Make sure that you have already had the <strong>.htaccess</strong> file in your PrestaShop&#8217;s root directory, which has the content like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
&nbsp;
# URL rewriting module activation
RewriteEngine on
&nbsp;
# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop1250/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop1250/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$3&amp;isolang=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$2&amp;isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/category.php?id_category=$2&amp;isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop1250/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop1250/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /prestashop1250/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /prestashop1250/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /prestashop1250/$2?isolang=$1 [QSA,L,E]
&nbsp;
# Catch 404 errors
ErrorDocument 404 /prestashop1250/404.php</pre></div></div>

<p>You can generate this <strong>.htaccess</strong> file from admin panel at <strong>Tools</strong> tab, then choose <strong>Generators</strong> sub-tab, and follow the instructions carefully there. In this example above, I use <strong>prestashop1250</strong> for the domain name. Please adjust it with yours.
</li>
<li>
Add this following code after the last line of that code above:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># Remove Category ID from URL. You have to modify also the /classes/Link.php file! Modified by Masino Sinaga, May 3, 2010
RewriteRule ^accessories-ipod$ /prestashop1250/category.php?id_category=3 [QSA,L,E]
RewriteRule ^music-ipods$ /prestashop1250/category.php?id_category=2 [QSA,L,E]
RewriteRule ^laptops$ /prestashop1250/category.php?id_category=1 [QSA,L,E]</pre></div></div>

<p>It meant that we will adjust the 3 categories name: accessories-ipod, music-ipods, and laptops. In other words, if you have more than 3 categories above, you have to define or add your own category one by one into the .htaccess file.
</li>
<li>
Open your <strong>/classes/Link.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCategoryLink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link_rewrite</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'category.php?id_category='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'category.php?id_category='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'category.php?id_category='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCategoryLink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">,</span> <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #666666; font-style: italic;">/*intval($id_category-&gt;id).'-'.*/</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link_rewrite</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'category.php?id_category='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">allow</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #666666; font-style: italic;">/*intval($id_category).'-'.*/</span><span style="color: #000088;">$alias</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
			<span style="color: #009900;">&#40;</span>_PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'category.php?id_category='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #0000ff;">'category.php?id_category='</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$id_category</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Now you should have the URL without the category id. In the next article I will try to modify for the others (cms id, product id, etc).</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F05%2F03%2Fhow-to-remove-category-id-from-url-of-prestashop-version-1-2-5%2F&amp;title=How%20to%20Remove%20Category%20ID%20from%20URL%20of%20PrestaShop%20version%201.2.5" id="wpa2a_10"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/05/03/how-to-remove-category-id-from-url-of-prestashop-version-1-2-5/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>How to Check Whether a URL Exists or Not Without Visitting The Page</title>
		<link>http://www.openscriptsolution.com/2009/12/25/how-to-check-whether-a-url-exists-or-not-without-visitting-the-page/</link>
		<comments>http://www.openscriptsolution.com/2009/12/25/how-to-check-whether-a-url-exists-or-not-without-visitting-the-page/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 16:54:59 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[exist]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[visit]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1076</guid>
		<description><![CDATA[This simple script is very useful for you if you want to check whether a URL exists or not without having to visit the page. This script using PHP, and I have tested it. It worked like a charm. Of course, you need to modify further the way you want, for example, this function will [...]]]></description>
			<content:encoded><![CDATA[<p>This simple script is very useful for you if you want to check whether a URL exists or not without having to visit the page. This script using PHP, and I have tested it. It worked like a charm. Of course, you need to modify further the way you want, for example, this function will be called when a button is clicked, and so on. But we are not here to discuss these details. This example as simple as possible in the hope that you can develop further according to individual needs. <span id="more-1076"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>  
&nbsp;
   <span style="color: #000000; font-weight: bold;">function</span> checkURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
     <span style="color: #000088;">$check</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
     <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$check</span><span style="color: #009900;">&#41;</span>  
       <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>  
     <span style="color: #b1b100;">else</span>  
       <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>        
     <span style="color: #b1b100;">return</span> <span style="color: #000088;">$status</span><span style="color: #339933;">;</span>  
   <span style="color: #009900;">&#125;</span>  
&nbsp;
   <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.openscriptsolution.com&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// &lt;-- change with other URL</span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>checkURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
     <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #006699; font-weight: bold;">$url</span>&gt;<span style="color: #006699; font-weight: bold;">$url</span>&lt;/a&gt; &lt;b&gt;exists&lt;/b&gt;.&quot;</span><span style="color: #339933;">;</span>  
   <span style="color: #009900;">&#125;</span>  
   <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>  
     <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #006699; font-weight: bold;">$url</span>&gt;<span style="color: #006699; font-weight: bold;">$url</span>&lt;/a&gt; does &lt;b&gt;not&lt;/b&gt; exist.&quot;</span><span style="color: #339933;">;</span>  
   <span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F25%2Fhow-to-check-whether-a-url-exists-or-not-without-visitting-the-page%2F&amp;title=How%20to%20Check%20Whether%20a%20URL%20Exists%20or%20Not%20Without%20Visitting%20The%20Page" id="wpa2a_12"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/12/25/how-to-check-whether-a-url-exists-or-not-without-visitting-the-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Subdomain, The Redirecting Script From URL Without www to www Will Not be Useful</title>
		<link>http://www.openscriptsolution.com/2009/11/22/using-subdomain-the-redirecting-script-from-url-without-www-to-www-will-not-be-useful/</link>
		<comments>http://www.openscriptsolution.com/2009/11/22/using-subdomain-the-redirecting-script-from-url-without-www-to-www-will-not-be-useful/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 15:32:59 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[prefix]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[subdomain]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=900</guid>
		<description><![CDATA[If you have ever read my article Redirecting URL Without www to URL With www Using .htaccess File regarding how to redirect the URL of a website from its address that being typed by visitor without the prefix www become the address with prefix www, then the redirecting script will not be useful at all. [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever read my article <a href="http://www.openscriptsolution.com/2009/10/17/redirecting-url-without-www-to-url-with-www-using-htaccess-file/">Redirecting URL Without www to URL With www Using .htaccess File</a> regarding how to redirect the URL of a website from its address that being typed by visitor without the prefix www become the address with prefix www, then the redirecting script will not be useful at all. For example, your main website domain is <strong>mydomain.com</strong>, then by using that redirect script in that article, if you have subdomain, for instance, <strong>mysubdomain.mydomain.com</strong> which this <strong>mysubdomain</strong> sub directory will be located under the root of your <strong>mydomain.com</strong>, then your URL will be converted to: <strong>http://www.mydomain.com/mysubdomain/</strong>. Of course, we do not expect this condition happened, right? So, how is the solution? <span id="more-900"></span></p>
<p>Well, if you use the redirect script which we have discussed in that article above, you should remove it from your <strong>.htaccess</strong> file in order your URL will be displayed properly become http://mysubdomain.mydomain.com. In the other words, since you used the subdomain, you have to reconsider about the using of that redirect script, if you do not want the URL of your subdomain changed as we mentioned above.</p>
<p>I discovered about this behavior when I created a subdomain for my another website. I hope this information will be useful for you.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F11%2F22%2Fusing-subdomain-the-redirecting-script-from-url-without-www-to-www-will-not-be-useful%2F&amp;title=Using%20Subdomain%2C%20The%20Redirecting%20Script%20From%20URL%20Without%20www%20to%20www%20Will%20Not%20be%20Useful" id="wpa2a_14"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/11/22/using-subdomain-the-redirecting-script-from-url-without-www-to-www-will-not-be-useful/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Notify Staff Member of Their New Account in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/10/22/notify-staff-member-of-their-new-account-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/10/22/notify-staff-member-of-their-new-account-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 03:25:30 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[akun]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[send]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=656</guid>
		<description><![CDATA[This following article will show you how you can add a small feature into osTicket version 1.6 RC5 about notify staff members of their accounts right away after they have been created by Admin or their Manager. When Admin or Manager create a new staff account, then osTicket will send email to the staff email [...]]]></description>
			<content:encoded><![CDATA[<p>This following article will show you how you can add a small feature into osTicket version 1.6 RC5 about notify staff members of their accounts right away after they have been created by Admin or their Manager. When Admin or Manager create a new staff account, then osTicket will send email to the staff email that contains of username and password, including the URL for login to the osTicket System. <span id="more-656"></span></p>
<p>Open your <strong>\scp\admin.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>410
411
412
413
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uID</span><span style="color: #339933;">=</span>Staff<span style="color: #339933;">::</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #339933;">,</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #000088;">$msg</span><span style="color: #339933;">=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">htmlchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' added successfully'</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Unable to add the user. Internal error'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uID</span><span style="color: #339933;">=</span>Staff<span style="color: #339933;">::</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #339933;">,</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$msg</span><span style="color: #339933;">=</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">htmlchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'lastname'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' added successfully'</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$helpdesk_email</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$helpdesk_url</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$helpdesk_title</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$helpdesk_email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                       <span style="color: #000088;">$helpdesk_email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Your New Account'</span><span style="color: #339933;">,</span> 
  <span style="color: #0000ff;">''</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'firstname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',
&nbsp;
  We have just created you a new account on '</span><span style="color: #339933;">.</span><span style="color: #000088;">$helpdesk_title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':
&nbsp;
  This is your account detail:
&nbsp;
  Username: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' 
  Password: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'npassword'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
&nbsp;
  You may login now from: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$helpdesk_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'scp/
&nbsp;
  Please keep this email securely for your archive.
&nbsp;
  Sincerely,
  '</span><span style="color: #339933;">.</span><span style="color: #000088;">$thisuser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>  
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Unable to add the user. Internal error'</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Hopefully this will help you.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F22%2Fnotify-staff-member-of-their-new-account-in-osticket-v1-6-rc5%2F&amp;title=Notify%20Staff%20Member%20of%20Their%20New%20Account%20in%20osTicket%20v1.6%20RC5" id="wpa2a_16"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/22/notify-staff-member-of-their-new-account-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Needed to Activate A Ticket in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/10/20/password-needed-to-activate-a-ticket-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/10/20/password-needed-to-activate-a-ticket-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 02:45:15 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[activate]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[closed]]></category>
		<category><![CDATA[delay]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[sandi]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[send]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[ticket]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=632</guid>
		<description><![CDATA[The aim of the title of this article is to provide the additional prerequisite that is password when client obviously wanted to open a new ticket in osTicket System v1.6 RC5. I made this modification by adding a new field named password in ost_ticket table. After client open a new ticket, then osTicket will generate [...]]]></description>
			<content:encoded><![CDATA[<p>The aim of the title of this article is to provide the additional prerequisite that is password when client obviously wanted to open a new ticket in osTicket System v1.6 RC5. I made this modification by adding a new field named <strong>password</strong> in <strong>ost_ticket</strong> table. After client open a new ticket, then osTicket will generate the new password and display a message that inform client about the password that has just been sent to the client&#8217;s email. The ticket will be set to &#8216;delay&#8217; status at this moment, instead of set to &#8216;open&#8217; status. This password then will be automatically being sent by osTicket to the client&#8217;s email including the URL contains of that password. Afterwards, client has to click on that URL link in order to activate the ticket (in this case, osTicket will change the ticket status from &#8216;delay&#8217; become &#8216;open&#8217;). Therefore, staff will be able to see that ticket on the ticket list via staff-panel. <span id="more-632"></span></p>
<ol>
<li>
First of all, you have to alter your <strong>ost_ticket</strong> table, by adding a new field named <strong>password</strong>, and also add a new enum with <strong>delay</strong> value, into the <strong>status</strong> field, besides the existing value: &#8216;open&#8217;, &#8216;closed&#8217;. Please also make sure that you have set &#8216;delay&#8217; as the default value. It means, each time client open a new ticket, the status is become &#8216;delay&#8217; instead of &#8216;open&#8217;.</p>
<p>You may use this SQL from your phpMyAdmin or another MySQL tools:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ALTER TABLE ost_ticket 
ADD COLUMN `password` varchar(20) NULL;</pre></div></div>

</li>
<li>
Open your <strong>\include\client\thankyou.inc.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
     Thank you <span style="color: #b1b100;">for</span> contacting us<span style="color: #339933;">.&lt;</span>br<span style="color: #339933;">&gt;</span>
     A support ticket request has been created and a representative will be getting back to you shortly <span style="color: #b1b100;">if</span> necessary<span style="color: #339933;">.&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>
     Thank you <span style="color: #b1b100;">for</span> contacting us<span style="color: #339933;">.&lt;</span>br<span style="color: #339933;">&gt;</span>
     An email has been sent to your email contains of the URL with password to activate this ticket<span style="color: #339933;">.&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>\include\class.ticket.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1194
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$extId</span><span style="color: #339933;">=</span>Ticket<span style="color: #339933;">::</span><span style="color: #004000;">genExtRandID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after that line of code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1195
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> Ticket<span style="color: #339933;">::</span><span style="color: #004000;">generatePassword</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Find again this code, and make sure that code located inside the create() function:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1207
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #0000ff;">',source='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1207
1208
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #0000ff;">',source='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>
                <span style="color: #0000ff;">',password='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// MOD Open Ticket With Password, Added by Masino Sinaga, Oct 19, 2009</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1336
1337
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">   <span style="color: #000000; font-weight: bold;">function</span> generatePassword<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$password</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #990000;">srand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>double<span style="color: #009900;">&#41;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$length</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
       <span style="color: #000088;">$password</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">substr</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$chars</span><span style="color: #339933;">,</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chars</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #b1b100;">return</span> <span style="color: #000088;">$password</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">function</span> updateTicketStatus<span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'UPDATE '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' SET status=\'open\', password=\'\' WHERE password='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> db_affected_rows<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
       <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
     	 <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>open.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$errors</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$password</span><span style="color: #339933;">=</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Ticket<span style="color: #339933;">::</span><span style="color: #004000;">updateTicketStatus</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span>CLIENTINC_DIR<span style="color: #339933;">.</span><span style="color: #0000ff;">'header.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Thank you for activating your ticket. We will response it as soon as possible.'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span>CLIENTINC_DIR<span style="color: #339933;">.</span><span style="color: #0000ff;">'footer.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Incorrect password or ticket status has been activated.'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>42
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$inc</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'thankyou.inc.php'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$helpdesk_email</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDefaultEmail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$helpdesk_url</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$helpdesk_title</span><span style="color: #339933;">=</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$helpdesk_email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$sqle</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT email, password FROM '</span><span style="color: #339933;">.</span>TICKET_TABLE<span style="color: #339933;">.</span>
                <span style="color: #0000ff;">' WHERE ticketID='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getExtId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$respe</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$countRec</span> <span style="color: #339933;">=</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$respe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> db_fetch_array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$respe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>	
          <span style="color: #000088;">$helpdesk_email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Password for Your Ticket #'</span><span style="color: #339933;">.</span><span style="color: #000088;">$ticket</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getExtId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">.</span><span style="color: #000088;">$username</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', You are receiving this notification because you have (or someone pretending to be you has) requested a new ticket on &quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$helpdesk_title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;. If you did not request this notification then please ignore it, if you keep receiving it please contact your Administrator. Otherwise, in order to activate your new ticket so that we will receive it, please click on this link: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$helpdesk_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'open.php?password='</span><span style="color: #339933;">.</span><span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ol>
<p>That&#8217;s all. Now each time client open a new ticket, then osTicket will send the password including the URL link to the client&#8217;s email. After the URL link clicked, then the ticket will be activated, and staff will be able to see this ticket on the list. </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F20%2Fpassword-needed-to-activate-a-ticket-in-osticket-v1-6-rc5%2F&amp;title=Password%20Needed%20to%20Activate%20A%20Ticket%20in%20osTicket%20v1.6%20RC5" id="wpa2a_18"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/20/password-needed-to-activate-a-ticket-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Redirecting URL Without www to URL With www Using .htaccess File</title>
		<link>http://www.openscriptsolution.com/2009/10/17/redirecting-url-without-www-to-url-with-www-using-htaccess-file/</link>
		<comments>http://www.openscriptsolution.com/2009/10/17/redirecting-url-without-www-to-url-with-www-using-htaccess-file/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 05:36:07 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[consistency]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[HTTP_POST]]></category>
		<category><![CDATA[IfModule]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[prefix]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[RewriteBase]]></category>
		<category><![CDATA[RewriteCond]]></category>
		<category><![CDATA[RewriteEngine]]></category>
		<category><![CDATA[RewriteRule]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[visitor]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=610</guid>
		<description><![CDATA[Today I learnt something new again about how to redirect my website if the visitors type in their browser such as this address: http://openscriptsolution.com (without prefix www.) then the browser will be automatically redirected it to the http://www.openscriptsolution.com (with prefix www.). This is very important for those of you who have the website, since you [...]]]></description>
			<content:encoded><![CDATA[<p>Today I learnt something new again about how to redirect my website if the visitors type in their browser such as this address: http://openscriptsolution.com (without prefix www.) then the browser will be automatically redirected it to the http://www.openscriptsolution.com (with prefix www.). This is very important for those of you who have the website, since you have to decide which URL that you will use for the consistency of your URL. In addition, Google loves the consistency of the URL that we used for our website. That&#8217;s what I have heard and known from Internet. So, here is the code how you can do that for your website by using .htaccess file. <span id="more-610"></span></p>
<ol>
<li>
Open your <strong>.htaccess</strong> file that located inside your web root directory, and then add this following code into that file:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.openscriptsolution\.com [NC]
RewriteRule ^(.*)$ http://www.openscriptsolution.com/$1 [L,R=301]
&lt;/IfModule&gt;</pre></div></div>

</li>
<li>
Now when your visitors type http://openscriptsolution.com in their browser, then it will be automatically redirected it to the address: http://www.openscriptsolution.com.
</li>
</ol>
<p>Hopefully this will be helpful for you.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F10%2F17%2Fredirecting-url-without-www-to-url-with-www-using-htaccess-file%2F&amp;title=Redirecting%20URL%20Without%20www%20to%20URL%20With%20www%20Using%20.htaccess%20File" id="wpa2a_20"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/10/17/redirecting-url-without-www-to-url-with-www-using-htaccess-file/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
