Tuesday 31 January 2023

How to remove .html from URL?

 Use the following code in .htaccess file to remove .html from url. 

This code will work for static html files. 

example.com/page.html   to example.com/page

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteBase /

RewriteCond %{https://example.com} !(\.[^./]+)$

RewriteCond %{REQUEST_fileNAME} !-d

RewriteCond %{REQUEST_fileNAME} !-f

RewriteRule (.*) /$1.html [L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP

RewriteRule ^([^.]+)\.html$ https://example.com/$1 [R=301,L]

</IfModule>

Monday 18 January 2021

Amazon Great Republic Day Sale 20th – 23rd January

 

Amazon Great Republic Day Sale will start from 20 January and end 23 January. The sale will start early for Prime Members a day before on 19 January.

Great Republic Day Sale

prime Members

The Amazon Great Republic Day Sale have great features discounts and offers on Mobiles, Electronics, Fashion apparel and accessories, home appliances, daily essentials and many more products.

The Amazon Great Republic day sale will also release instant 10% discount on credit cardholders of SBI bank.

Check out the Best Features of The Amazon Great Republic day sale:

Customers can expect up to 40 percent off on Mobiles and accessories from popular brands.

Amazon will also offer exchange offers on most of the products.

Customers will see discounts on Xiaomi Redmi Note 9, Samsung Galaxy M21, iPhone 7, OnePlus 8 5G and Nokia 5.3. There will also up to 75 percent off on headphones, up to 30,000 off on laptops, and up to 45 percent discount on tablets during Amazon Great Republic Day Sale.

Mobile OffersElectronics

Kitchen productsDaily Essentials

FashionTV

Brands & MoreBooks

Amazon Great Republic Day Sale, Amazon Great Republic Day Sale 2021, Amazon Great Republic Day Sale deals, Amazon Great Republic Day Sale offers, IPhone 12 mini, smart tv, laptop, amazon sale, Amazon Great Republic Day Sale on January 2021

Thursday 16 April 2020

How to get last executed query in Codeigniter?

Are you want to display last executed query in Codeigniter ?
You can use last_query() function of db class in Codeigniter.


You can use in controller and get output of last executed query:






Example : 


public function get_cities(){  

           $query = $this->db->get("cities"); 


           $str = $this->db->last_query(); 

           echo "<pre>";

           print_r($str);

           exit;

}



Output:


SELECT * FROM `items`







Friday 3 April 2020

Why Codeigniter Shopping Cart doesn't allow any special character in the name?

Codeigniter Cart have some rules for product name in following format :

$product_name_rules = '\w \-\.\:';   (Codeigniter 3).

You can see this rule in Cart Library.

Here no any special character allow in product name. So, need some modification for allow special character. You can add same product name in cart with following modification in your cart class not in default Cart Library.

Add the following syntax before insert cart :


$this->cart->product_name_rules = '[:print:]';


After add this syntax your code looks like :


$this->cart->product_name_rules = '[:print:]';
$this->cart->insert(array());


'[:print:]' - allow to insert product name with special character.