Re: [PHP] when redirecting, a 0kb file is downloaded
- Date: Mon, 25 Jan 2016 10:17:41 -0800
- From: Negin Nickparsa <nickparsa@xxxxxxxxx>
- Subject: Re: [PHP] when redirecting, a 0kb file is downloaded
Here is the script, it is inside Magento.
<?php require __DIR__ . '/app/Mage.php'; Mage::app();
ini_set('memory_limit', '32M'); set_time_limit (0); $category_id
= 4; $catagory_model =
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->addCategoryFilter($catagory_model); //category filter
$collection->addAttributeToFilter('status',1); //only enabled product
$collection->setStoreId(11);//dealer portal, I did store 1, seems all
url keys were not there echo count($collection)."<br>";
foreach ($collection as $_product):?>
<?php echo $_product->getSku();?><a href="<?php echo
<?php $redirect =
->addFieldToFilter('identifier', "car-audio/" .
->setOptions('RP') ->setIdentifier("car-audio/" .
->setDescription("car-audio import " . $_product->getSku())
->save(); } endforeach;
On Sat, Jan 23, 2016 at 3:29 AM, Richard <
> > Date: Friday, January 22, 2016 15:03:11 -0800
> > From: Negin Nickparsa <nickparsa@xxxxxxxxx>
> > This is the weirdest thing could ever happen.
> > I ran a php script of redirecting about 200 urls with a particular
> > category to be sent to product detail pages and they worked fine
> > on my local machine which is windows.
> > our staging server is nginx, so I think it should be from some
> > configurations but I cannot figure this out.
> > Could you please let me know what you think about this?
> > it will redirect to right page but does not reload the page and
> > then download a file with the name of url and the file is 0kb.
> > it seems that I have the same .htaccess file, but server
> > configurations are definitely different.
> > Thanks,
> > Negin
> Without seeing any of your script, configurations, logs, or a full
> description of what you are doing, it's kind of hard to guess what
> might be different between your two instances. Show your work.
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php