Data feed file integration price comparison shopping script

Documentation Wiki - DataFeedFile.com - Online merchant datafeed integration for affiliates : modrewriteexamplestepbystep

HomePage | Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Home Affiliate FAQ Merchant FAQ Examples Merchants Networks & Programs Forum Blog Wiki Knowledge Base Login

Revision [77]

This is an old revision of modrewriteexamplestepbystep made by FannyAbunawas on 2008-06-10 13:14:31.
 

mod_rewrite example step by step


Follow the step-by-step instructions below to create a working mod_rewrite + URL Schema example same as what we have at DFF example.
DFF mod_rewrite example link: http://www.datafeedfile.com/examples/modrewrite/pse.html

Step 1 - Enter URL Schema


1. Login to ACP (affiliate control panel)
2. Go to Settings > URL Schemas tab
3. Create a new URL schema #1 with the following

http://www.datafeedfile.com/compare_price-<<<seo>>>-<<<param>>>

inside the Product Price Comparison text box.

4. You can enter any Schema Name
5. Save the URL Schema

image


Step 2 - Add mod_rewrite in Apache httpd.conf or .htaccess file


Depending on your web server setting / environment, you must enter the following mod_rewrite rules in either httpd.conf (apache main configuration file) or .htaccess (per directory configuration file).

Apache 1.x or 2.x:

RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
RewriteRule ^(.*)/compare_price-(.*)-([0-9]+)$ /compareprice.php?dffsku=$3 [L,QSA]


Lighttpd 1.x:

url.rewrite-once = ( 
	"^(.*)/compare_price-(.*)-([0-9]+)?(.*)$"		=>		"/examples/modrewrite/compareprice.php?dffsku=$3&$4"
	)


Note: Most server require Web Server's process restart to load new configuration changes into effect.

Step 3 - Create compareprice.html or compareprice.php


Create a new HTML or PHP file at your ROOT directory name it compareprice. and put the following source into it:

For HTML (javascript):

<script type="text/javascript" src="http://www.datafeedfile.com/dff_jsthrow.php?affid=1001&script=prdtmain&style=2"></script>


For PHP:

<?php
  $dffsku=trim($_GET['dffsku']);
  if($dffsku=="") { echo "Need DFFSKU<br>"; exit; }
   else
	 {
	  include('http://www.datafeedfile.com/dffphp_script_prdtmain.php?dffget_affid=1001&dffget_style=2&dffget_dff_product_sku='.$dffsku.'&'.$_SERVER['QUERY_STRING']);
	 }
?>


Step 4 - Test the product price comparison page


Load the compareprice. page you have just created like this:

http://www.yourdomainname.com/compareprice.html
or
http://www.yourdomainname.com/compareprice.php

It should complain about missing DFFSKU. That is correct, don't panic

There are no comments on this page. [Add comment]

Integrate price comparison shopping data feed file from thousands of online merchant product data feeds | Valid CSS

Page was generated in 0.0140 seconds